|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-05-22 17:41 UTC] 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>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 15:00:01 2025 UTC |
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); ?>