QuickForm 2.4 to 2.5 upgrade problem-- ElementGroup
| From: | culley harrelson | Date: | Wed, 27 Nov 2002 00:32:14 +0000 |
| Subject: | QuickForm 2.4 to 2.5 upgrade problem-- ElementGroup | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-2852@lists.php.net to get a copy of this message | ||
The code below worked with Quickform 2.4 but does not work with 2.5. The default value doesn't carry over from frozen to non-frozen mode...
<?php
require_once ("HTML/QuickForm.php");
$defaultValues['testing']= 't';
$form = new HTML_QuickForm("form1");
$form->setDefaults($defaultValues);
$radio[] = &HTML_QuickForm::createElement('radio', null, null, 'Yes', 't');
$radio[] = &HTML_QuickForm::createElement('radio', null, null, 'No', 'f');
$form->addElementGroup($radio, 'New Window:', 'testing');
if (isset($_POST["edit_button"])) {
$form->addElement('submit', 'save_button', 'Save Changes');
} else {
$form->addElement('submit', 'edit_button', 'Edit Values');
}
if ($form->validate() && isset($_POST["save_button"])) {
echo "done";
exit;
}
if (!isset($_POST["edit_button"])) {
$form->freeze();} $form->display(); ?>