javascript - can jQuery.post method submit the form to next step? -
I'm looking for the jQuery.post
method. I am getting information from my clients in five stages, asking for the first step, I am getting information from my customer and saving them to DB using the jQuery.post
method, When the data has been saved successfully, I submit the form in the next step
but I am not able to do this? Any suggestions?
code:
if (error == incorrect) {jQuery.post ("<< php echo home_url ();? & Gt; / wp-content / Plugins / email-masta / inc / campaign_save.php ", {camp: camp_name, sname: se nder_name, semail: sender_email, step: camp_step}, function (resp) {if (resp! = '') {Warning (" Submit some ("Form: First"); // jQuery ("Form: First") ();} and {Warning ("Data Inserted"); // jQuery ("Form: First"). Submit ( );}});}
Definitely you set the location You can go to the next step by href
(this is not a good solution):
jQuery.post ("& lt ;? ph P echo home_url () ;? & gt; / wp-content / plugins / mail-masta /inc/campaign_save.php ", {camp: camp_name, sname: se nder_name, semail: sender_email, step: camp_step}, function } {Location.href = '/nextstep.html';});
However, if you have 5 pages, then just use jQuery.post
Do not - & lt; Use form method = "POST" & gt;
is more appropriate for submitting data and redirecting the server to the next step.
Another way is to modify the page with javascript jQuery.post
so that the browser does not have to load the next step. This is the reason why you are using JavaScript and Ajax.
Comments
Post a Comment