|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23763 button value incorrect after validate()
Submitted: 2003-05-22 17:41 UTC Modified: 2003-05-28 11:32 UTC
From: nlenz at ivcf dot org Assigned:
Status: Closed Package: PEAR related
PHP Version: 4.3.1 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: nlenz at ivcf dot org
New email:
PHP Version: OS:


 [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

$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()) {




Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-23 02:54 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
$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
$buttons[] = &HTML_QuickForm::createElement('submit', null, 'Submit');
$buttons[] = &HTML_QuickForm::createElement('reset', null, 'Reset');

 [2003-05-28 11:32 UTC]
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at

This is now fixed in release 3.0RC1.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Jan 23 14:03:42 2022 UTC