google-code-export / lwrte

Automatically exported from code.google.com/p/lwrte
1 stars 0 forks source link

Form validation breaks design mode toggle #55

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add validation to form on submit, and ensure validation fails
2. Attempt to toggle design mode via [html] and [css] btns
3. Observe additional toolbar created, and general buggyness

Original issue reported on code.google.com by eamonnoc...@gmail.com on 22 May 2010 at 8:41

GoogleCodeExporter commented 9 years ago
Suggested solution:

Use jquery custom event, and remove any use of input type=hidden.
Instead do:

$j(self.iframe)
            .parents('form').submit(
        function() {
                    self.disable_design_mode();
                } 
            )
            .bind('invaliddata', function(){
                self.enable_design_mode();
            });

And if the validation in form fails:

 $form.trigger('invaliddata');

It worked for me.

Original comment by eamonnoc...@gmail.com on 24 May 2010 at 8:02