After thinking about what you said I have simply duplicated the line
that sets the submit button to disabled and moved it to the
constructor, I have then changed this duplicated line so that it
enables the button. This makes sure that when the page loads the
submit button is enabled.

Thanks.

On May 27, 11:06 pm, 4fingers <[email protected]> wrote:
> Hi and thanks for the suggestion,
>
> Sadly the section of code I gave is inside a class that is called
> inside a domready.
>
> e.g.
> window.addEvent('domready', function(){
>     var myFormValidation = new Validate('loginForm');
>
> });
>
> Any other ideas?
>
> On May 27, 10:17 pm, Fábio Costa <[email protected]> wrote:
>
> > this.form.getElements('input[disabled=disabled]').set('disabled',false);
>
> > ondomready may do the trick.
>
> > Fábio Miranda Costa
> > Engenheiro de Computaçãohttp://meiocodigo.com
>
> > On Wed, May 27, 2009 at 6:00 PM, 4fingers <[email protected]> wrote:
>
> > > Hi all,
>
> > > I have some basic Mootools that will disable the submit button when
> > > the user submits the form:
>
> > > this.form.addEvent('submit', function(e){
> > >        var event = new Event(e);
> > >        var doSubmit = true;
> > >        this.elements.each(function(el,i){
> > >                if(! this.validate(el)){
> > >                        event.stop();
> > >                        doSubmit = false
> > >                        this.list.include(el);
> > >                }else{
> > >                        this.list.erase(el);
> > >                }
> > >        }.bind(this));
>
> > >        if(doSubmit){
> > >                if(this.options.onSuccess){
> > >                        event.stop();
> > >                        this.options.onSuccess(this.form);
> > >                }else {
>
> > >  this.form.getElement('input[type=submit]').set('disabled',true);
> > >                }
> > >        }
> > > }.bind(this));
>
> > > This works fine except in Firefox after the form has been submitted
> > > you can then press the back button to see the form again whereby the
> > > submit button is still disabled.
>
> > > Does anyone have any ideas how to prevent this so that the back button
> > > gives a submit button that is no longer disabled?
>
> > > Thanks

Reply via email to