Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<b>How to enable a text box by clicking on a radio button</b>

Status
Not open for further replies.

jlawler

Programmer
Feb 26, 2003
14
IE
I have a form containing a text box (which is disabled when loaded) and a yes/no radio button pair. I want to enable the text box once the 'yes' radio option is chosen. How can I best do this?

 
[tt]<form name=&quot;form1&quot; id=&quot;form1&quot; method=&quot;post&quot; action=&quot;&quot;>
<input name=&quot;enableText&quot; type=&quot;radio&quot; value=&quot;no&quot; checked=&quot;checked&quot; onclick=&quot;if(this.checked){this.form.theTextBox.disabled=true;}&quot; />no<br />
<input name=&quot;enableText&quot; type=&quot;radio&quot; value=&quot;yes&quot; onclick=&quot;if(this.checked){this.form.theTextBox.disabled=false;}&quot; />yes<br />
<input name=&quot;theTextBox&quot; type=&quot;text&quot; disabled=&quot;true&quot; />
</form>[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top