Re: Quickform - clientside disabling of form elements
| From: | Bertrand Mansion | Date: | Tue, 27 May 2003 12:24:56 +0000 |
| Subject: | Re: Quickform - clientside disabling of form elements | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-5614@lists.php.net to get a copy of this message | ||
<sfisk@quantiv.com> wrote :
> Hi there
>
> Im tying to put together a page that will let you enter your medication I
> want them to check radio button to show if their medication is current or
> not. If it is, I want to disable a quickform date set of three select boxes
> so they cant enter a date that they finished their medication if they are
> still taking it. Any clues on how to do this?
>
> Thanks
> Steve
That's javascript. Just add a javascript disabler function into your
template or as a static element. If the function is called 'disableDate()',
then add an 'onclick' => 'disableDate()' attribute to your radio element:
$radio =& HTML_QuickForm::createElement('radio', 'current', null,
array('onclick' => 'disableDate();'));
In disableDate(), you need to check if the radio is checked or not and
accordingly disable the date element. Elements in forms have properties that
can be accessed with javascript, check them out to see which one you have to
change. I am not sure onclick is the right event to call though.
Bertrand Mansion
Mamasam