View Full Version : document.formulier.submit() and NS
MrPink
06-23-2002, 11:50 PM
Hi there,
Can someone tell me why this is working fine in Internet Explorer but not working in Netscape?
<div id="contacttxt" style="position:absolute; z-index:1; visibility: default;">
<div align="center"><a href="javascript:document.formulier.submit()"><img src="img/submit.gif" name="submit" border="0"></a> <a href="javascript:document.formulier.reset()"><img src="img/reset.gif" name="reset" border="0"></a></div>
and the form is in this layer:
<div id="formuliertxt" style="position:absolute; z-index:1;">
<form name="formulier" method="post" action="form.cgi">
TIA,
MrPink
MrPink
06-24-2002, 10:13 AM
Thanks Dave for you reply, but.....
It's stil not working. I've replaced the double quotes with quotes, I've removed them, I've replaced and removed the brackets, but it's still not working.......
Any suggestions? Is it possible NS can't find the specified layer because there about 30 layers in this document?
Thanks for your help sofar,
MrPink
MrPink
06-24-2002, 01:55 PM
Mmmmmh.....well that's exactly what's going on. The layer 'formuliertxt' is within the layer 'contacttxt'.
Is there a way to overcome this? Like
document.layers['contacttxt'].document.layers['formuliertxt'].document.formulier.reset()
?
I could easily put the submit- and resetbutton underneath the form, but the designer (graphical designer) wanted them above the form (and technicaly that means outside of the 'formuliertxt'-layer.)
Thanks anyway,
MrPink
joh6nn
06-24-2002, 04:49 PM
take a look at this page. it has a function for recursively looping through layers in NS4, to get to the appropriate object.
http://www.xs4all.nl/~ppk/js/dhtmloptions.html
hope that helps.
TrueLies
06-25-2002, 12:51 AM
Hi
oh yup, if you have 30 divs and the browser is, as I understtod it NN4, definitely yes, the problem are the layers: one thing you always have to do with NS4 is, for instance, to define all your layers soon after the body tag: nothing in between the body tag and the layers if they are many layers.
Also, NN4 "alleges" at times that the layer doesn't exist if you do not provide it with a FULL set of properties as follows:
position: absolute
top (do assign it)
left (do assign it)
visibility (no, no default: either visible or hidden if we're dealing with the elusive mr NN4...)
z-index (do assign it)
Then, if in NN4 you nest a layer in a layer, that can work if you keep, as they already outlined, a reference to the document...document!
Also, on NN4 if you nest an ordinary div or table in a positioned layer and you give to such div an align property or to such table an align property, youy may see NN4 doing the strangest things.
Remove fake divs from within your layers, and tables as well.
Move all your layers soon after the body tag
Give to them a full set of Css properties
Be sure you do this on all layers. IF (if) it was a NN 4 issue, all this would help it a LOT in case of many layers
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.