Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setting a radio button

 
Joseph Miller
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
anyone know how to set a radio button checked with javascript? I'm confused because they have the same name...
<input type=radio name='exampleRadio' value='1'>
<input type=radio name='exampleRadio' value='2'>
so if I want to set the value 2 radio button to checked based on some other user action how do I do it? this.formName.exampleRadio.checked...
thnx.
Joe
 
James Swan
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is a brief example:

Note change "on-Click" to "onClick", had to post the code like this
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic