this.form.getElements('input[disabled=disabled]').set('disabled',false);

ondomready may do the trick.

Fábio Miranda Costa
Engenheiro de Computação
http://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