#23763 [WFx->Csd]: button value incorrect after validate()

From: Date: Wed, 28 May 2003 16:32:07 +0000
Subject: #23763 [WFx->Csd]: button value incorrect after validate()
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-16783@lists.php.net to get a copy of this message
ID: 23763 Updated by: mansion@php.net Reported By: nlenz at ivcf dot org -Status: Wont fix +Status: Closed Bug Type: PEAR related Operating System: Linux PHP Version: 4.3.1 New Comment: Thank you for your bug report. This issue has already been fixed in the latest released version of PHP, which you can download at http://www.php.net/downloads.php This is now fixed in release 3.0RC1. Previous Comments: ------------------------------------------------------------------------ [2003-05-23 02:54:07] avb@php.net 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); ?> ------------------------------------------------------------------------ [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

« previous php.pear.dev (#16783) next »