javascript - Do a jQuery/ajax POST on form submit -


i have html form this:

<form action="myserver.com/test.php" method="post"> ... </form> 

when form submitted, user should redirected myserver.com/test.php , ofc send post data script. @ same time (or before), want post same post data script "myserver.com/test2.php".

$.post("myserver.com/test2.php", variablewiththeformpostdata); 

i tried attach eventlistener form submit, doesn't seem work, maybe jquery post cant submitted fast enough before redirection?

i hope can me. :(

whenever use method onsubmit, make sure returns true, otherwise won't submit.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -