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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically disabling a radio button based on user selection

Status
Not open for further replies.

morphine

Programmer
Nov 16, 2003
1
US
I have the following form:

I want to be able to select Jane in step 1.
Once she has been selected in step 1 she can't be selected in step 2.

How would i do this?
 
The solution is rather simple and logical. I suppose you could have figured it out yourself.

What you have done is ---

<input type=&quot;radio&quot; name=&quot;imposterPic&quot; value=&quot;name&quot; border=&quot;0&quot;>

in both the table rows... You should use different names to the radio in both the rows. This will solve the problem. This, if you realise, is due to the fact that you can select only one radio of a group of radio-buttons. The solution lies in making two groups by using two names, say &quot;imposterPic1&quot; and &quot;imposterPic2&quot;.
 
Code:
formName.imposterPic[1].disabled=true

should do the trick, just add that to the onclick element of your first radio button

-kaht

banghead.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top