I'm using bootstrap 3.0 form and want to do ajax submit instead of regular one.
I like bootstrap's form validation and I use preventDefault() to stop original form from firing.
but form still keeps firing on submit so I get 2 submits instead of one.
I now removed "action" url from the HTML form so it now fires on .html?parms
how do I prevent original form from firing?
I tried on "click" but bootstrap's validation stops working if I do that.
$('#investorsSubmit').on('submit', function (e) {
e.preventDefault();
$('#investorsSubmit').ajaxSubmit({
type: 'post',
url: 'http://www.ccccc.com/php/inv.php',
//data: $("#send-form").serialize(),
success: function (responseText, statusText, xhr, $form) {
$('#thanks-modal').modal('show');
$(this).closest('form').find("input[type=text], textarea, url").val("");
}, error: function (responce, error) {
//alert('error');
}
});
return false;
});