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

multiple scripts question 1

Status
Not open for further replies.

jags22

Programmer
Oct 17, 2001
44
US
I have a script that opens a list of radio buttons when a checkbox has been checked. What I want to do now is when the user selects one of the radio buttons, have a script promote the name of the radio button to a text field on the form, uncheck the checkbox and not display the list. I have it sending the correct value to my javascript that I want to promote to the form but I don't now how to get that value to show up on the form? Any suggestions will be appreciated. Thanks...
 
Make your radio buttons of the form:
Code:
<input type=radio name=rad value=val1 onClick=passThis(this)>
(notice the radio button OBJECT is being passed in the function call)

Make the function of the form:
Code:
function passThis(radButton)
{
 form.textbox.value = radButton.name;
 form.checkbox.click(); //checkbox of interest
}
*(replace form, textbox, and checkbox with appropriate names)

Here, I am assuming that the checkbox has an onclick event associated with it that will hide the radio buttons when the checkbox is unclicked as well.

Also, I'm guessing you really want to pass the value of the radio button, in which case, change the appropriate line in the passThis(...) function, above, to &quot;... = radButton.value&quot;.

'hope this helped.

--Dave
 
works like a champ, thanks definitely worth a star
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top