i have the fallowing example:
<input type="button" id="create_account" value="Save">
var Misc = {
validateForm: function () {
if(x == 1){
return false;
}
// this is a simplified example, but sometimes x != 1 and there is no return
}
}
$(document).on('click', '#create_account', function() {
Misc.validateForm();
alert('continue');
});
the issue i'm having is that i get continue
, even though i return false.
what i would like to happen is to run the alert only if Misc.validateForm();
doesn't return anything
any ideas on this issue?