Problem with sending ajax request

5 years 1 week ago #8097 by fantako
I have a form. It sends data to php-script. But I would like to add on click event to send ajax request to another page (in addition to the main form action). So when I click submit button, ajax sends. It returns alert (in 'done' section), but PHP-handler at /payment page is not working as expected (it works perfectly if i just send ajax request without sending standard from action). Can anybody help to resolve this issue? This is my js:

$( "#place_btn" ).click(function() { if($('#payment').is(':checked')) { var x = 1; $.ajax({ method: "POST", url: "/payment", data: { var_x: x } }) .done(function() { alert("aaa"); }); }; });

Please Log in or Create an account to join the conversation.

5 years 12 hours ago #8101 by Saka
And this is in relation to which component/module?

Emir Sakic
www.sakic.net

Please Log in or Create an account to join the conversation.

About us

We provide high quality Joomla components created by a co-founder and original core developer of Joomla. For over a decade, our products have been used by more than 20.000 webmasters around the world.

Stay in touch