Side navigation
#5722 closed bug (invalid)
Opened December 28, 2009 08:08PM UTC
Closed June 13, 2010 11:23PM UTC
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 (5)
Changed December 28, 2009 09:42PM UTC by comment:1
Changed December 28, 2009 10:10PM UTC by comment:2
- 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
Changed December 28, 2009 10:13PM UTC by comment:3
I tested with firefox 3.5.6
Changed January 16, 2010 03:39PM UTC by comment:4
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.
Changed June 13, 2010 11:23PM UTC by comment:5
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.