Usually when you want to refer to a form element you do this:
document.formname.elementname.value
however, the way my javascript is made i need to use a variable that stores the name of the element to refer to it. For example:
var a = namefield;
document.formname.a.value;
However, all this does is looks for an element called 'a'.
Any Ideas on what I can do?
document.formname.elementname.value
however, the way my javascript is made i need to use a variable that stores the name of the element to refer to it. For example:
var a = namefield;
document.formname.a.value;
However, all this does is looks for an element called 'a'.
Any Ideas on what I can do?