Results 1 to 19 of 19

Thread: I hate divs and javascript [Resolved]

Threaded View

  1. #1

    Thread Starter
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945

    I hate divs and javascript [Resolved]

    Everytime I do this, it doesn't work. All I'm trying to do is toggle between 2 divs.

    Script:
    Code:
    function toggle() { 
    // DOM3 = IE5, NS6 
    document.getElementById('div1').style.visibility = 'visible'; 
    document.getElementById('div2').style.visibility = 'hidden'; 
    } 
    
    function toggle2() { 
    // DOM3 = IE5, NS6 
    document.getElementById('div1').style.visibility = 'hidden'; 
    document.getElementById('div2').style.visibility = 'visible'; 
    }
    Call to them:
    PHP Code:
    echo "<br><br><input type=radio name=opt value=1 onclick='toggle()'>Specify Test";
            echo 
    "<input type=radio name=opt value=1 onclick='toggle2()'>Specify Cell<br>";
            echo 
    "<div id=div1 style=visibility:visible>testtesttesttest</div>";
            echo 
    "<div id=div2 style=visibility:hidden>test2test2test2test2test2</div>"
    IT WON'T WORK AND I MIGHT PULL MY HAIR OUT.
    Last edited by ober0330; Jul 23rd, 2004 at 08:16 AM.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

Posting Permissions

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



Click Here to Expand Forum to Full Width