QuickForm setDefaults problem ?
| From: | Levy | Date: | Sun, 01 Feb 2004 14:13:34 +0000 |
| Subject: | QuickForm setDefaults problem ? | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-10471@lists.php.net to get a copy of this message | ||
Hi all.
require_once "HTML/QuickForm.php";
$form = new HTML_QuickForm('formAddUser', 'post');
$form->setDefaults(array( 'name' => '1' )); //Hvave tried to put 'Paul' also
$form->addElement('select', 'name', 'Names:',array('1'=>'Paul','2'=>'Jack'));
$form->addElement('reset', 'btnClear', 'Clear');
$form->addElement('submit', 'btnSubmit', 'Submit');
if ($form->validate()) {
// Form is validated, then processes the data
$form->freeze();
echo "\n<HR>\n";
}
$form->display();?> ------------------------------------------------------- setSelected(); doesn't work either, have tried that. I don't understand what I'm doing wrong and I think I have tried every possible workarounds (execpt for the right one ofcourse :P) ca someone please reply, I really am desperate :/ Levy