Re: Freezing submit button in HTML_QuickForm onSubmit

From: Date: Mon, 17 Nov 2003 14:16:31 +0000
Subject: Re: Freezing submit button in HTML_QuickForm onSubmit
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-8990@lists.php.net to get a copy of this message
<bs@hi.is> wrote : > I am trying to freeze the submit button after a form has been submitted. > > $form = new HTML_QuickForm('testform', 'POST', > $_SERVER['PHP_SELF'], > '_self', > 'onSubmit="document.getElementById(\'SubmitBtn\').disabled = > true;"'); > $form->addElement('text', 'data', 'Input string:'); > $this->addRule('data', 'Input string must be filled out', > 'required', > null, 'client'); > $form->addElement('submit','SubmitBtn','Submit form'); > > Maybe I should have the extra attributes for the constructor as > array('onSubmit' => "document.getElementById('SubmitBtn').disabled > = > true;") ? > > This however does not work since onSubmit is set for the form for the > client-side rule validation ( onsubmit="return validate_testform();" ). > > Am I dont this all wrong or is there any other way to do this ? I don't really know, maybe you can try: onsubmit='this.disable=true;return true;' ? Bertrand Mansion Mamasam

« previous php.pear.general (#8990) next »