Re: Quickform group element default
| From: | Bertrand Mansion | Date: | Tue, 22 Jul 2003 10:39:35 +0000 |
| Subject: | Re: Quickform group element default | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-6711@lists.php.net to get a copy of this message | ||
<mikeatwork@ukonline.co.uk> wrote :
> Hi
>
> i have three quickform elements in a group. the three elements represent the
> parts of a persons name 'title', 'firstname', 'surname'.
>
> $adult["title"] = &HTML_QuickForm::createElement('select',
> 'title', '',
> $titles);
> $adult["firstname"] = &HTML_QuickForm::createElement('text',
> 'firstname', '',
> array('size' => 25, 'maxlength' => 30));
> $adult["surname"] = &HTML_QuickForm::createElement('text',
> 'surname', '',
> array('size' => 25, 'maxlength' => 30));
>
> They are grouped into a group names 'adultGroup'.
> $form->addGroup($adult, "adultGroup", $language['L_AdultName']);
>
> i would like to set the default only in the 'surname' box.
>
> Looking at
> �
> Tž¡ÌÙ‹Ã »Ró¢åhttp://www.appelsiini.net/~tuupola/php/peardoc2/package.html.html-quickform.ht
> ml-quickform.setdefaults.html
> there is no explination of setting an elements default when it is within a
> group.
>
> How is it done? and can the documentation be merged in to the weekly pear docs
> build ? please please :-)
Should be merged since a week now...
$default['adultGroup'] = array('surname' => 'Carter');
$form->setDefaults($defaults);
Bertrand Mansion
Mamasam