I'm trying to use this validator https://github.com/1000hz/bootstrap-validator for client-side checking and then allowing the ajax submission of an entire form. I can't find an example in the docs and my current code doesn't work, it reloads the whole page with the values as a GET query string. Any thoughts? Thanks!
$('#send-form').validator().on('submit', function (e) {
if (e.isDefaultPrevented()) {
// handle the invalid form...
} else {
// everything looks good!
$.post( "/post/ajax",
$( "#send-form" ).serialize(),
function( data ) {
$( "#ajax-result" ).html( data );
});
}
});
e.preventDefault()aboveif (e.isDefaultPrevented())?