Cross-browser <div>

Discussion in 'OT Technology' started by eric_stlouis, Feb 22, 2005.

  1. eric_stlouis

    eric_stlouis New Member

    Joined:
    Oct 10, 2003
    Messages:
    147
    Likes Received:
    0
    Hello all:

    I'm trying to write some code that will make a form disappear after a user hits the "submit" button.

    I have to make it cross-browser compatible with the latest versions of Mozilla and IE.

    My div tag looks like this:

    <div id="divtag1">
    Here is my form
    </div>

    I just want to make it invisible with javascript.

    I've tried many variations, but always run into problems.

    My most recent attempt is:

    if (document.layers)
    {
    document.layers["divtag1"].visibility='hide';
    }
    else
    {
    document.all['divtag1'].style.visibility='hidden';
    }


    I've also tried "getElementById" and that doesn't work.

    Any suggestions would be GREATLY appreciated!!!
     
  2. intrktevo

    intrktevo New Member

    Joined:
    Oct 18, 2004
    Messages:
    5,781
    Likes Received:
    0
    Location:
    UCF
    why not send them to a different page with whatever you want on it and not worry about if the form is visible or not :dunno:
     
  3. tac

    tac (:-|)=|=

    Joined:
    Jan 3, 2001
    Messages:
    21
    Likes Received:
    0
    Location:
    vancouver
    if all you want to do is hide the div, then its easy:

    document.getElementById('divtag1').style.display = 'none';
     

Share This Page