Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add form reset() method breaks on cancel in IE and FireFx #29

Closed
GoogleCodeExporter opened this issue Jun 13, 2015 · 4 comments
Closed

Comments

@GoogleCodeExporter
Copy link

Hi, 
after a problem, adding a comment on the following lines let me close the 
dialog popup window:

         //Called when user cancels adding new record in the popup dialog
        function _fnOnCancelRowAdding(event) {
            //Close the dialog
            oAddNewRowForm.dialog('close');
//            $(oAddNewRowForm)[0].reset();
            $(".error", $(oAddNewRowForm)).html("");
            event.stopPropagation();
            event.preventDefault();
        }
if not, IE and FireFox issue an error (inexistent method on the object).

is that a bad work around , what is the purpous of this code ? 
thanks and sorry for noise 



Original issue reported on code.google.com by philippe...@gmail.com on 8 Jun 2011 at 5:58

@GoogleCodeExporter
Copy link
Author

This code is used to reset form fields once the user press cancel button (so 
blank form can be shown next time he opens add dialog). I have tried it in 
several browsers and it worked fine. Without this line if you populate fields, 
press cancel, and add button again you will see all fields you entered in the 
previous dialog.

Issue you have reported is strange because reset() is a standard function for 
reseting forms. Could you see in the firebug is the $(oAddNewRowForm)[0] 
standard form element? In all my examples it is a frm and therefore it works 
fine.

Could you try to take the latest version of plugin I have slightly changed this 
code (reseting form is moved before dialog close maybe this is problem in your 
browser).


Regards,
Jovan

Original comment by joc...@gmail.com on 11 Jun 2011 at 8:57

  • Changed title: Add form reset() method breaks on cancel in IE and FireFx

@GoogleCodeExporter
Copy link
Author

Hi,

I'm sorry, I made a error using a 'div' instead of a 'form' as sAddNewRowFormId 
dom element. I think this is the cause of the problem. 

Perhaps a control could be done to avoid this kind of misuse ? 

Thanks for your answer.





Original comment by philippe...@gmail.com on 11 Jun 2011 at 2:16

@GoogleCodeExporter
Copy link
Author

I'm not sure about this check because I'm trying to put minimal number of 
constraints related to the HTML structure.
In the future maybe form will be required tag but maybe it will not be required 
at all I have still not choosen the road map for this.
Currenly I'm assuming that stucture is created according to the examples/wiki 
pages.

Regards,
Jovan

Original comment by joc...@gmail.com on 11 Jun 2011 at 7:20

  • Added labels: Type-Other
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

Original comment by joc...@gmail.com on 17 Jun 2011 at 7:35

  • Changed state: Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant