Bug Tracker

Modify

Ticket #3675 (closed feature: wontfix)

Opened 5 years ago

Last modified 4 years ago

reset event

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

Description

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

Attachments

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

Change History

Changed 4 years ago by dmethvin

test of form reset event

comment:1 Changed 4 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to worksforme

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

comment:2 Changed 4 years ago by woodspire

  • Status changed from closed to reopened
  • Resolution worksforme deleted

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 4 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 4 years ago by brandon

  • Status changed from reopened to closed
  • Resolution set to wontfix

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");
};

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.