View Full Version : Radio button reference

08-22-2007, 11:12 PM

Ok, so I have only 1 radio button on my page & I want to reference it for a message but I cant get it to work. What is wrong with this reference?

if(document.formName.radioName[0].checked == true)

I have no problems looping through more than one, but cant this to work for a single button. Why??



08-22-2007, 11:55 PM
Can you show us your form elements too? It doesn't make sense to me at first glance, should work with just one button.

08-23-2007, 12:06 AM
I just played around a bit with a single radio button and sure enough the array does not exist, but the single radio non-array object can be referred to, i.e. if(document.form1.radioBtn.checked) {}

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum