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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Feb 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Rookie script failure - function error

    I know I'm a newbie and most of you will spot the error, but I can't figure it out for the life of me:

    Currently, I have two ways to do the same thing, a test so that I can replicate things repeatedly. One relies on a function (that I can easily have multiple hidden ids, classes, etc), the other is inline:

    Code:
    //Green works, red doesn't, they should produce the same result for my test.
    
    <script type="text/javascript">
    function CoverPage(transect)
    {
    document.getElementById(transect).style.visibility="hidden";
    }
    </script>
    </head>
    <body>
    
    <input type="button" value="Hide Table" onclick=document.getElementById("TransectOne").style.visibility="hidden";>
    
    <input type="button" value="Transect One" onlcick=CoverPage(TransectOne);>
    Thanks in advance,
    Brian

  • #2
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,300
    Thanks
    28
    Thanked 275 Times in 269 Posts
    Quote Originally Posted by climberbrian View Post
    I know I'm a newbie and most of you will spot the error, but I can't figure it out for the life of me:
    You mistyped onclick.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #3
    New to the CF scene
    Join Date
    Feb 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you so much, this has been driving me nuts for 2 days.
    Brian


  •  

    Tags for this Thread

    Posting Permissions

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