Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

radio buttons

 
colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is an array

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

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic