...

View Full Version : Radio button reference



MKO
08-23-2007, 12:12 AM
Hi

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??

Thanks

M

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

Fumigator
08-23-2007, 01: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