Problem with sending ajax request
- fantako
- Topic Author
- Offline
- New Member
Less
More
- Posts: 1
- Thank you received: 0
5 years 7 months 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"); }); }; });
$( "#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.
- Saka
- Offline
- Administrator
5 years 7 months ago #8101
by Saka
Emir Sakic
www.sakic.net
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.