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

radio button with onclick

Status
Not open for further replies.

funkydonkey2000

Programmer
May 29, 2003
12
0
0
AU
Just wondering if you want your page to do something immediately when the user click on one of you radio buttons on your form, do you have to add a onclick attribute to all your radio button tags. such as this

<input type='radio' name='radioName' value='0' onclick=javascript:somefunction>0<br>
<input type='radio' name='radioName' value='1' onclick=javascript:somefunction>1<br>
<input type='radio' name='radioName' value='2' onclick=javascript:somefunction>2<br>

or is there a better way of doing it?

Thanks

Tony
 
Unless i'm proven wrong by someone else, yes the onClick must be on all radio buttons. Although 'you' are grouping the radio buttons together to the page they are all individual and so each one requires it's own individual action.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top