Created
May 19, 2016 10:15
-
-
Save krikunts/3be27f1d6b124962474755207b998b5e to your computer and use it in GitHub Desktop.
POST form using JQuery
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
| <script type="text/javascript"> | |
| var frm = $('#FORM-ID'); | |
| frm.submit(function () { | |
| $.ajax({ | |
| type: "POST", | |
| url: "YOUR URL", | |
| data: frm.serialize(), | |
| success: function (data) { | |
| // get results from data | |
| }, | |
| error: function(data) { | |
| // display error | |
| } | |
| }); | |
| return false; | |
| }); | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment