Freezing submit button in HTML_QuickForm onSubmit
| From: | Birgir Stefansson | Date: | Mon, 17 Nov 2003 14:01:03 +0000 |
| Subject: | Freezing submit button in HTML_QuickForm onSubmit | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-8989@lists.php.net to get a copy of this message | ||
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 ?
HTML_QuickForm version 3.1
Tia.
Birgir