[thelist] checkbox referencing

Tom Dell'Aringa pixelmech at yahoo.com
Tue May 28 17:37:00 CDT 2002


Hey E'ers.

I'm working on a page where I am switching frame views with 3 radio buttons (long story.) Anyway,
I am mimicking link behavior by <span>ing the text labels for the radio buttons with a hand
cursor. Of course, clicking this doesn't change the radio button (only changes the frames). So I
needed to include switching the radio button if they clicked the fake "link" instead of the
button.

My problem came in referencing the radio object. This project is IE only, and of course this
reference works:

document.all.toggler[2].checked = true;

Toggler being the name of my radio group. However, this:

document.getElementById("toggler")[2].checked = true;

does NOT work. This is IE5.50, so getElementById certainly works (I am using it everywhere.) I did
indeed set an ID of "toggler" for the radio buttons as well as the NAME attribute. The error I get
is that such and such reference is not an object (although clearly it is.)

I am thinking this is some strange DOM implementation thing. I'd like to keep my code consistent.
Any ideas or anyone see this before?

Tom

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com



More information about the thelist mailing list