Skip to content

Instantly share code, notes, and snippets.

@krikunts
Created May 19, 2016 10:15
Show Gist options
  • Select an option

  • Save krikunts/3be27f1d6b124962474755207b998b5e to your computer and use it in GitHub Desktop.

Select an option

Save krikunts/3be27f1d6b124962474755207b998b5e to your computer and use it in GitHub Desktop.
POST form using JQuery
<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