wdf2006
25 Jul 2006, 01:56 PM
I have a dropdown menu (SELECT) in my web form named 'CloseAcct'. The dropdown menu is created with PHP as a hiden SELECT field. The field name of the hiden SELECT field is 'department'. User can select a department name from a list of departments by clicking that SELECT field.
For Firefox and Netscape, I use DOM reference document.forms.CloseAcct.department.value to get the name of the department user selected easily and successfully. However, that DOM reference does not work for IE. I tried the following posssible DOM references supported by IE, but none of them works:
document.getElementById("department").value
document.all["department"]
document.getElementByTagName("select")
What is the right DOM reference in IE that is equivalent to document.forms.CloseAcct.department.value? I got really frustrated with the confusing DOM in IE. Hope someone here could help. Thank you in advance.
For Firefox and Netscape, I use DOM reference document.forms.CloseAcct.department.value to get the name of the department user selected easily and successfully. However, that DOM reference does not work for IE. I tried the following posssible DOM references supported by IE, but none of them works:
document.getElementById("department").value
document.all["department"]
document.getElementByTagName("select")
What is the right DOM reference in IE that is equivalent to document.forms.CloseAcct.department.value? I got really frustrated with the confusing DOM in IE. Hope someone here could help. Thank you in advance.