|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
48 - 13 = ?
Subscribe to this entry?

 [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: Sat Jan 22 06:03:34 2022 UTC