wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes radio buttons 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 "radio buttons" Watch "radio buttons" New topic

radio buttons

colin shuker
Ranch Hand

Joined: Apr 11, 2005
Posts: 743
I have 2 radio buttons using the same name in a form:

I have a reset button in form that calls the function resetFields.
How can I change the checked button back to the 'Male' option
in this function.

I am tying to use something like...

But that isn't quite right.
Any ideas? Thanks.
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15376
It is an array

document.formName.gender[0].checked = true;

I agree. Here's the link: http://aspose.com/file-tools
subject: radio buttons
Similar Threads
code attached element existance in javascript
Radio Validator
setting a radio button
Using Struts Creating the Radio Button for gender
Question on using DisplayTag in JSPs