Skip to main content

Bug Tracker

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)
  • ticket5722.html (0.7 KB) - added by s.baronnet December 28, 2009 10:07PM UTC.
Change History (5)

Changed December 28, 2009 09:42PM UTC by dmethvin comment:1

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.

Changed December 28, 2009 10:10PM UTC by s.baronnet 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 s.baronnet comment:3

I tested with firefox 3.5.6

Changed January 16, 2010 03:39PM UTC by iraebrasil 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 dmethvin comment:5

component: unfiledevent
resolution: → invalid
status: newclosed