Created
July 29, 2013 16:34
-
-
Save danilo04/6105627 to your computer and use it in GitHub Desktop.
Jquery send ajax form serialize
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // this is the id of the submit button | |
| $("#submitButtonId").click(function() { | |
| var url = "path/to/your/script.php"; // the script where you handle the form input. | |
| $.ajax({ | |
| type: "POST", | |
| url: url, | |
| data: $("#idForm").serialize(), // serializes the form's elements. | |
| success: function(data) | |
| { | |
| alert(data); // show response from the php script. | |
| } | |
| }); | |
| return false; // avoid to execute the actual submit of the form. | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment