I have some questions with jQuery submit function.
here is work environment
jQuery: 1.7.2, chrome (18.0.1025.168 m).
There are 2 problems.
1st:
my codes like this
html
<form id="test" action="..." method="post">
<input type="text" />
<input type="submit">
</form>
jQuery
$('#test').submit(function(){
return false;
})
the problem is it works fine in firefox and opera but chrome.
2st:
html: as above.
jQuery:
$('#test').submit(function(){
if(...)
alert(something..);
return false;
})
it dosen’t work in firefox,opera and chrome. it always trigger form.submit why.
I am very confused it. who can figure it out thanks!
Don’t use
return false;. Try this instead: