Hi
I have the following fucntion, which works. I would like to prevent the submission of the form in case that errorMessage.length is greater then 0. I tried with e.preventDefault, nothing, I try return false...nothing. Form is still submitted.
Any help?Code:formLogin.on('submit', function(){ $.ajax({ type: 'POST', url: 'backOffice/loginCheck', data: $(formLogin).serialize(), dataType: 'json', success: function(errorMessage){ if(errorMessage.length > 0) { $('#errorMessageTop').fadeIn(); } return false; } }); });
Regards,zoreli



Reply With Quote



Bookmarks