Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1733 How do you dynamically write a form field to a layer so Netscape displays it?

You are here: irt.org | FAQ | JavaScript | Form | Q1733 [ previous next ]

Netscape Navigator 4 uses separate documents for each layer. Therefore each form field you attempt to place in a layer meust be encapsulated within its own form tags, otherwise it will not render correctly.

Try using:

<html>

<head>

<script language="JavaScript"><!--
function updateLayer(object, text) {
  if (document.getElementById)
    document.getElementById(object).innerHTML = text;
  else if (document.all)
    document.all[object].innerHTML = text;
  else if (document.layers && document.layers[object]) {
    document.layers[object].document.open();
    document.layers[object].document.write(text);
    document.layers[object].document.close();
  }
}
//--></script>

</head>

<body onLoad="updateLayer('myLayer', '<form><input type=\'text\'></form>')">

<div id="myLayer" style="position: absolute">
</div>

</body>

</html>

Feedback on 'Q1733 How do you dynamically write a form field to a layer so Netscape displays it?'

©2018 Martin Webb