[thelist] Using variables in DOM object names

Ryan Rushton web at ryanrushton.com
Tue Jul 12 21:57:35 CDT 2005


At 11:13 PM 7/12/2005, you wrote:
> > Because there are many form fields to set, I would like to place them in
> > an array and loop over the array, but I don't know how to properly refer
> > to the objects when they have a variable within their name.  Here is my
> > NON-working code:
> >
>
>How about using globally used document.getElementById (which is also
>the standard way of doing it) ?
>
>imho, you are over-complicating the problem.
>Besides imho, your code should work. if I don't miss something.
>Can you give an URL to check?

It's been awhile since I did much Javscript and I totally forgot about 
getElementById.  No less, I still can't seem to make it work, even with 
getElementById.  I have posted a simplified version at 
http://www.ryanrushton.com/demos/master.html


More information about the thelist mailing list