#23763 [Opn->WFx]: button value incorrect after validate()
| From: | avb@php.net | Date: | Fri, 23 May 2003 07:54:07 +0000 |
| Subject: | #23763 [Opn->WFx]: button value incorrect after validate() | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-16632@lists.php.net to get a copy of this message | ||
ID: 23763
Updated by: avb@php.net
Reported By: nlenz at ivcf dot org
-Status: Open
+Status: Wont fix
Bug Type: PEAR related
Operating System: Linux
PHP Version: 4.3.1
New Comment:
This problem will appear only when creating unnamed elements in a named
group. The fix will be either to give names to submit and reset
buttons
<?php
$buttons[] = &HTML_QuickForm::createElement('submit', 'subbutton',
'Submit');
$buttons[] = &HTML_QuickForm::createElement('reset', 'resbutton',
'Reset');
$form->addGroup($buttons, 'buttons_');
?>
or not to give a name to a group
<?php
$buttons[] = &HTML_QuickForm::createElement('submit', null, 'Submit');
$buttons[] = &HTML_QuickForm::createElement('reset', null, 'Reset');
$form->addGroup($buttons);
?>
Previous Comments:
------------------------------------------------------------------------
[2003-05-22 17:41:22] nlenz at ivcf dot org
Run this test, enter "@#$^" into the test field.
After submitting the form, the reset button's value is "Submit" instead
of "Reset".
This is in QuickForm 3.0beta2
<pre>
$form = new HTML_QuickForm('testform', 'post');
$form->setDefaults(array('test'=>'This is a test'));
$form->addElement('text','test','Testing Field:');
$buttons[] = &HTML_QuickForm::createElement('submit', null, 'Submit');
$buttons[] = &HTML_QuickForm::createElement('reset', null, 'Reset');
$form->addGroup($buttons, 'buttons_');
$form->addRule('test','Test must be alphanumeric','alphanumeric');
if ($form->validate()) {
$form->freeze();
}
$form->display();
</pre>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23763&edit=1