Bug Tracker

Opened 14 years ago

Closed 13 years ago

Last modified 13 years ago

#794 closed bug (fixed)

Default action gets called with FF2 even after jQuery(f).submit(function(e) { ... }) is defined.

Reported by: tuupola@… Owned by:
Priority: major Milestone: 1.1
Component: event Version: 1.1
Keywords: Cc:
Blocked by: Blocking:

Description

Default form action gets called (browser submits the form) with FF2 even after jQuery(f).submit(function(e) { ... }) is defined with code below. This used to work with 1.0.4. I have tested with OSX FF 2.0.0.1 and Safari 2.0.4. Code fails only with FF.

Live examples at:

http://www.appelsiini.net/~tuupola/jquery/bugs/onblur-1.1b.html http://www.appelsiini.net/~tuupola/jquery/bugs/onblur-1.0.4.html

$(document).ready(function() {

    var f = $('form');
    var i = document.createElement('textarea');
    i.name = 'foo';

    var b = document.createElement('input');
    b.type = 'submit';
    b.value = 'OK';

    f.append(i);
    f.append(b);

    jQuery(i).blur(function(e) {
         jQuery(f).submit();
    });

    jQuery(f).submit(function(e) {
        e.preventDefault(); 
        console.log('submit');
    });
});

Change History (1)

comment:1 Changed 13 years ago by john

Milestone: 1.1
Resolution: fixed
Status: newclosed

Fixed in SVN rev 1049.

Note: See TracTickets for help on using tickets.