I am using Bootstrapvalidation to check my input fields. On top of that, I have additional check that is done on submit. It's either submitted without showing errors or, when I use this:
$("#form").submit(function(ev){
ev.preventDefault();
});
$("#submit-form").on("click", function(){
var valid=some code for additional check;
if (valid) {
$("#form").submit();
}
else {
return;
}
});
But then it's just all recursive and the form doesn't get submitted. How to I get this to work?