I need to do some validate before form submit.
I can not modify the html code and existing js (the only way is to add new js file).
I tried this one:
$('form').submit(function() {
alert("check");
return false;
});
but it does not call.
I tried this one too:
$(document).on('submit', 'form', function(e) {
alert("check");
return false;
});
it calls correctly but only for alert()
.
How is it possible to set false
for disable form submit when my checkFunction()
returns false?