Problem with sending ajax request

1 year 1 month 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.

1 year 1 month 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.

We also recommend

Twitter

sakicnet: Register into multiple groups with AJAX Register 3.8 https://t.co/oAt6IJJxQA 684 days ago from Twitter Web Client

Stay in touch