Entry
If I have <ILAYER></ILAYER> between FORM "start and end" tags all FORM-elements (e.g. buttons) disappear!!! Why?
Mar 8th, 2002 13:51
David Blackledge, Mike Hall, Dusan Stanic,
It's not documented but from experience I've found that you cannot mix
layers and forms within Netscape.
Likeswise, the ILAYER tag does not always behave as expected. The same
is true when mixing TABLE and LAYER or ILAYER tags.
Since both LAYER and ILAYER are proprietary (non-W3C standard) tags
invented by Netscape I suspect you'll have to live with those
limitations. Netscape 6 will not support these tags and I doubt they
will bother with a new version 4 release to correct them.
--------------------------------------------------------
Actually, it is documented, albeit vaguely. Netscape 4's Layers
technology is designed to effectively embed a mini-window inside the
document. As such, each layer has its OWN document made up of the
content between the LAYER and /LAYER (or ILAYER and /ILAYER) tags. From
Netscape 4's perspective, the question's situation looks to Netscape
like 3 documents.
1):
HEAD, BODY, all other content up to FORM and anything after the FORM tag
up to, but not including the ILAYER tag.
2):
everything inside the ILAYER tag (which doesn't include the FORM tags)
3):
everything after the /ILAYER tag including the /FORM tag, etc.
Netscape 4 has the additional restriction that no form elements show up
unless they are within FORM tags (since a form element has no real
purpose without being in a form, and that is how they are referenced in
script), and from Netscape's perspective, nothing on the above document
is between FORM tags (one has a begin but no end, one has neither, and
the third has just an end tag).
So, there are a few possible fixes for this:
1) make the entire form be inside the LAYER tags. This only works if
you want the entire form to act as one unit (for hiding/moving/etc)
2) make "mini-forms" for each layer.
like ILAYER id=layer1 FORM name=form1 INPUT name=input1 /FORM /ILAYER
ILAYER id=layer2 FORM name=form2 INPUT name=input2 /FORM /ILAYER
this requires dealing with the each form individually... if you submit a
form, it will only submit THAT form, not all of the forms, and
addressing the form elements from script requires first addressing the
layer, then its document, then its mini-form, THEN the element like:
var blah = document.layers.layer1.document.form1.input1.value;
2b) make mini-forms, but then have a "hidden" form as the real form that
will be submitted to the server. E.g. for each text item, have a
type="hidden" with the same name in the form that will be submitted,
then on the textitem include
onchange="window.document.hiddenform.textitem.value=this.value"
In this case, you don't even have to name the layers or the forms in the
mini-forms, since you never have to reference them.
Using option 2b will actually eliminate any cross-browser issues
regarding the forms, and you're only left with making the
layer-manipulation (hiding/moving/etc) work across browsers.
Note also that using positioned content in Netscape 4 (position:relative
or position:absolute in the stylesheet for ANY element) is equivalent to
using the LAYER and ILAYER tags.
David.
http://David.Blackledge.com