[Javascript] Selecting a form element

Terry Riegel riegel at clearimageonline.com
Wed Oct 4 08:09:44 CDT 2006


If I have a form element like

<input type="text" name="mydata">

Is there a way to select it in a similar manner to getElemntById()? I  
know how to do something like "document.forms.FORMNAME.mydata" but  
that requires me to know the name of the surrounding form which may  
not be named. I also know that I could add an id and use the  
ubiquitous getElementById(), but I would like to be able to select it  
just by its name.

Any Ideas?


Terry



More information about the Javascript mailing list