Re: selected item in select element?
| From: | Justin Patrin | Date: | Tue, 20 Dec 2005 00:20:36 +0000 |
| Subject: | Re: selected item in select element? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-22319@lists.php.net to get a copy of this message | ||
On 12/19/05, Charles Ross <chivalry@mac.com> wrote:
> How can I specify which item of a select element is selected? I have
> a line:
>
> $form->addElement('select', 'State', 'State:', $STATES);
>
> 99% of the time, I know what state the user will fill in, and I want
> that one to be selected, but I want the states to appear
> alphabetically in the menu.
>
Use setDefaults() on the fomr.
--
Justin Patrin