Meaningless Drivel is fun!*
The moose likes HTML, CSS and JavaScript and the fly likes setting a radio button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "setting a radio button" Watch "setting a radio button" New topic
Author

setting a radio button

Joseph Miller
Greenhorn

Joined: Jun 19, 2001
Posts: 21
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

Joined: Jun 26, 2001
Posts: 403
Here is a brief example:

Note change "on-Click" to "onClick", had to post the code like this
 
Consider Paul's rocket mass heater.
 
subject: setting a radio button
 
Similar Threads
selecting a radio button for IE & Netscape
how to retrieve data into radiobuttons
checkbox
Pass radio button to servlet
Radio Buttons