Page 1 of 1

Blocking text field when not needed

Posted: Sun Oct 05, 2008 11:59 pm
by 3hhh
<td height="30"><strong>Do you have a WWW password?</strong></td>
</tr>
<tr>
<td><input name="havePassword" type="radio" value="no" checked="checked" />
No</td>
</tr>
<tr>
<td><input name="havePassword" type="radio" value="yes" />
Yes :
<input name="password" type="password" id="password" />
</td>

Hi guys,

I need help on this. I only want to allow the user to enter the password in the password field textbox if he selects "yes" in the "havePassword" radio button. Thus, by default, I would like to "grey-out / block" the password text field. How can I do that? Appreciate your help.

Re: Blocking text field when not needed

Posted: Mon Oct 06, 2008 3:02 am
by PietM
You should add a 'enabled="false"' to the password-field. The you could assign an "onclick" javascript function to the "yes" button, that enables the passwordfield when pressed.