I have been looking at and rewriting this code from a textbook written in 2003. I believe the code is deprecated or at least old. I was under the impression the more up to date code uses getElementById(). Does anyone know how do get the same functionality using getElementById()?
There are other ways to make the code better though. Passing the parameters isn't necessary. You could get those directly as well. Or you could use a library like jQuery to make the code shorter.
Note that getElementByName doesn't do the same thing as getElementsById. Names are not guaranteed to be unique on a page.
Thanks Jeanne. I haven't tried it yet but what you wrote looks good. The code I posted was using only the name attribute because, as you probably know, it's designed to work that way. Thanks for the pointers and advice.