I have some JavaScript that accesses an element in a form:

window.document.forms[formID].elements[elementID].value

Where formID contains the name of the form and elemntID contains the name of the element. This works fine with IE and newer versions of Netscape.

How can I change this so it will work with Netscape 4.7? - I don't mind if I need to do a check for browser version and use a different code for the different browsers.

Any help appreciated.