Bug Tracker

Opened 14 years ago

Closed 14 years ago

#3675 closed feature (wontfix)

reset event

Reported by: Bouki Owned by: brandon
Priority: minor Milestone: 1.3
Component: event Version: 1.2.6
Keywords: reset event Cc:
Blocked by: Blocking:


I don't know why but the event corresponding to onreset is not implemented in jquery.

Attachments (1)

test-3675.html (568 bytes) - added by dmethvin 14 years ago.
test of form reset event

Download all attachments as: .zip

Change History (5)

Changed 14 years ago by dmethvin

Attachment: test-3675.html added

test of form reset event

comment:1 Changed 14 years ago by dmethvin

Resolution: worksforme
Status: newclosed

Seems to work for me in FF, IE, Chrome, and Safari.

comment:2 Changed 14 years ago by woodspire

Resolution: worksforme
Status: closedreopened

the bind function in jquery 1.3.2 works if you bind a 'reset' event, but there is no function reset() but there is a submit() function.

the line 3093 in jquery dev version should also list 'reset' as a possible function. Also, the documentation event documentation (http://docs.jquery.com/Events) should be updated to list the new reset function.

Also, it seems that jquery doesn't care if you try to bind a 'submit' even on an element other than a 'form'. Is that normal ? I would have taught that jquery would warn the user that it's incorrect.

comment:3 Changed 14 years ago by dmethvin

Please attach a test case that demonstrates the problem.

There is nothing wrong with attaching a "submit" event to any element, because code can always .trigger("submit") on an element whether the DOM does or not.

comment:4 Changed 14 years ago by brandon

Resolution: wontfix
Status: reopenedclosed

jQuery does not have shortcuts for all event types, just the most popular. There is not a corresponding .reset() short-cut. You must use .bind() or create a .reset() plugin.

$.fn.reset = function( fn ) {
    return fn ? this.bind( "reset", fn ) : this.trigger("reset");
Note: See TracTickets for help on using tickets.