I want to check on form submit that certain condition is satisfied before submitting the form
function checkConditions(e){
if ($('#someId').val() == '') {
console.log('value of #someId is empty');
e.preventDefault();
return false;
}
}
$('form').submit(function (e) {
checkConditions(e);
});
on form submit I'm getting print inside console that value is empty but form is sumbitted eitherway. What I'm doing wrong here?