This is probably a very simple question but I can't seem to get this right.
Is it possible to extract a variable "name" from a FORM? I have the following pull-down menus (Simplified)...
<FORM NAME="doc_select">
<SELECT ID="rec_list" NAME="rec_info"><OPTION>...</OPTION></SELECT>
<SELECT ID="term_list" NAME="term_info"><OPTION>...</OPTION></SELECT>
<SELECT ID="comp_list" NAME="comp_info"><OPTION>...</OPTION></SELECT>
</FORM>
These all trigger a bit of java-script via an "onChange" statement. So far so good.
I want to extract the name, not the value, and then use that extracted name in a java-script statement like below:
var info = form.*name*.value;
getElementsByName gives me the value not the name.
Any ideas?
Cheers Frank
getElementsByNameif you already know the name of the elements, which it does not seem you do here. Maybe you wantgetElementsByTagNameand then iterate over them? I'm not quite sure what you want to achieve.