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

Radio button question 2

Status
Not open for further replies.

snowboardr

Programmer
Feb 22, 2002
1,401
PH
I know this is javascript, but im not sure how to do it:

On click of a txt box I want it to check one of my 2 radio buttons, do I have to have both radio buttons named different? How would I do this?

onClick='form1.frmChange.value....


www.vzio.com
ASP WEB DEVELOPMENT



 
no - you can give them the same name (so only one can be chosen at a time) but you can give them unique ID's which Javascript can use to distinguish which one you mean.

use the following to 'check' the appropriate radio button:
Code:
document.formName.radioID.checked=true;
Tony
reddot.gif WIDTH=500 HEIGHT=2 VSPACE=3

 
I know I hate it when people add unnecessary info, but...
You can also reference them by the name as an array:
document.formname.radioname[0].checked = true
or
document.formname.radioname[1].checked = true
-Tarwn
------------ My Little Dictionary ---------
Reverse Engineering - The expensive solution to not paying for proper documentation
 
Thanks Tarwn, thats what I needed.
www.vzio.com
ASP WEB DEVELOPMENT



 
BTW, nice web page snowboardr, still working on mine (2hrs every other month :p )
-Tarwn ------------ My Little Dictionary ---------
Reverse Engineering - The expensive solution to not paying for proper documentation
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top