View Single Post
Old 05-14-2004, 11:06 PM   PM User | #2
sad69
Senior Coder

 
Join Date: Feb 2004
Posts: 1,206
Thanks: 0
Thanked 0 Times in 0 Posts
sad69 is an unknown quantity at this point
Well the reason it's undefined is because you've got TWO elements named 'gender'. So how does JS know which one you're talking about?

Because you've got two elements name gender, you've now got a gender array. Try this function instead of what you're using and see how it works out for you:
Code:
function myFunction() {
 for(var i = 0; i < document.forms[0].gender.length; i++) {
  if(document.forms[0].gender[i].checked)
   document.forms[0].actualValue.value = document.forms[0].gender[i].value;
 }
}
Let me know if you have any further questions/comments.

Sadiq.
sad69 is offline   Reply With Quote