Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jun 2002
    Location
    Netherlands
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy document.formulier.submit() and NS

    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>&nbsp;&nbsp;&nbsp;<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
    *** Don't eat yellow snow ***

  • #2
    New Coder
    Join Date
    Jun 2002
    Location
    Netherlands
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    document.layers['formuliertxt'].formulier.reset()

    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
    *** Don't eat yellow snow ***

  • #3
    New Coder
    Join Date
    Jun 2002
    Location
    Netherlands
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Layers within layers......and NS

    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
    *** Don't eat yellow snow ***

  • #4
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    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.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #5
    New Coder
    Join Date
    Jun 2002
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    Alberto http://www.unitedscripters.com/


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •