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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "radio buttons" Watch "radio buttons" New topic
Author

radio buttons

colin shuker
Ranch Hand

Joined: Apr 11, 2005
Posts: 744
Hello,
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
author
Rancher

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

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

Eric
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: radio buttons