Opened 14 years ago
Closed 13 years ago
#5722 closed bug (invalid)
return false on live submit doesn't prevent normal browser submit
Reported by: | s.baronnet | Owned by: | |
---|---|---|---|
Priority: | critical | Milestone: | 1.4 |
Component: | event | Version: | 1.4a2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
$("form").live('submit',function() { return false; });
the return false doesn't prevent normal browser submit
Attachments (1)
Change History (6)
comment:1 Changed 14 years ago by
Changed 14 years ago by
Attachment: | ticket5722.html added |
---|
comment:2 Changed 14 years ago by
- The problem is only with live binding
- a normal submit button works correctly
- a submit with an onclick="$('form').submit()" will not work correctly
see the test case attached
comment:4 Changed 14 years ago by
I dug into this problem. I noticed that the problem is not in .live() but the triggering of .submit() itself. After much debugging it seamed to me that was a browser problem. That's when I found this: https://developer.mozilla.org/en/DOM/form.submit
"Event handling markup like onsubmit="return false;" will not be evaluated when calling the submit method from code. The above code snippet will try and cancel the submit event which will not work when calling the submit method from code."
So it's not a jQuery fault. It's normal browser behavior. Therefore I think this bug is invalid and should be closed.
comment:5 Changed 13 years ago by
Component: | unfiled → event |
---|---|
Resolution: | → invalid |
Status: | new → closed |
Can you attach a complete test case? I think this may be a duplicate of #5705, the reporter there said it only happened on IE.