I have the following code:
Is there any reason why "this.form" wouldn't work in some browsers/operating systems? I thought it was pretty standard, but a user complained that the button wasn't doing anything for them in Firefox/Windows 7.Code:$(function() { // Attach onclick event to Clear buttons on all forms $('.resetForm-mthdClear').click( function() { // Reset the form this.form.reset(); // Remove selected="selected" from Select options $(this.form).find('option:selected').attr('selected',''); } ); });
Should I use:
instead?Code:$(this).closest('form').each( function() { this.reset(); } });


Reply With Quote

Bookmarks