3
rated 0 times
[
7]
[
4]
/ answers: 1 / hits: 35179
/ 12 Years ago, wed, january 9, 2013, 12:00:00
I have a form similar to the following:
<form method=post action=mail.php id=myForm>
<input type=text name=fname>
<input type=text name=lname>
<input type=text name=email>
<input type=submit>
</form>
I am new to AJAX and what I am trying to accomplish is when the user clicks the submit button, I would like for the mail.php
script to run behind the scenes without refreshing the page.
I tried something like the code below, however, it still seems to submit the form as it did before and not like I need it to (behind the scenes):
$.post('mail.php', $('#myForm').serialize());
If possible, I would like to get help implementing this using AJAX,
Many thanks in advance
More From » jquery