I\'m running into a bit of trouble while trying to cancel the submit of a form. I\'ve been following this tutorial (even though i\'m not making a login script), and it seems
I also had this problem, my code (that didn't work) was something like this:
$('#upload_form').submit(function(){ before_submit('argument') });
and inside the "before_submit" function i had "return false" to stop the form from submitting:
function before_submit() {
.........................................................
return false;
}
I put "return" when binding the event handler function to the form and it worked:
$('#upload_form').submit(function(){ return before_submit('argument') });
The function attached to the submit event has to return false (in my case the anonymous function). So...this is one solution to one cause of this problem