Forms Fields & Layers

(IE vs Netscape)

Click here - to test accessing forms within and without layers (<div>). Try with browsers IE & Netscape with a minimum version of 4.0. Notice that IE sees 2 forms, while Netscape only sees 1 form. Look at the JavaScript code for IE vs Netscape.

  • For IE, access forms in layers like no layers: document.forms[0].elements[0]
  • For Netscape, access forms in layers: document.layers[0].document.forms[0].elements[0]
  • Form1 element (no layer)
    Form2 element in a layer