Re: Quick_Form -- How to disable a select list in a group?
| From: | Bertrand Mansion | Date: | Wed, 25 Jun 2003 14:59:00 +0000 |
| Subject: | Re: Quick_Form -- How to disable a select list in a group? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-6230@lists.php.net to get a copy of this message | ||
<grahamc@53tech.com> wrote :
> I have a group of 3 select lists in a form -- each element is created like
> this.
>
> $selects['roles'] =& $roleForm->createElement('select',
> 'role_code');
> $selects['roles']->addOption('-- Select a Role', 0);
> $selects['roles']->loaddbResult($roles, 'role_name',
> 'role_code',
> $role_code);
>
> I want to selective "disabled" to the element --> so source would look like
> this
> <select name="role_code" disabled>
>
> Tried this to no avail
> $roleForm->addGroup($selects, 'roles', '',
> ' ', false);
> --->> $roleForm->updateElementAttr('parents', "disabled");
Did you try:
$selects['roles']->updateAttributes(array('disabled'=>'disabled'));
Bertrand Mansion
Mamasam