yawnmoth wrote:
> It's easy enough to get elements by their id (getElementById) or by
> their type (getElementsByTagName). What about doing so for form
> variable names? How might one go about getting the element(s)
> associated with document.forms[0].varname?
>
document.forms['formname']
gives you the HTML form element(s)with name 'formname'.
document.forms.formName.elements['controlname']
gives you the control(s) (e.g. input, textarea, select) with name
'controlname' in the form with name 'formName'.
--
Martin Honnen
http://JavaScript.FAQTs.com/