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
    Regular Coder howie2009's Avatar
    Join Date
    May 2009
    Location
    Ireland
    Posts
    204
    Thanks
    37
    Thanked 0 Times in 0 Posts

    pop up window with "don't show again" checkbox

    Hi Guys,
    I want to create a how to pop up with a checkbox that the user can tick to not show the pop up again so it may need to have a cookie applied to it.
    Anybody know how?
    Thanks

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,990
    Thanks
    203
    Thanked 2,536 Times in 2,514 Posts
    Well, what you want is something like this in the pop-up

    Instructions Here<br><br>

    Don't show me these instructions again <input type = "checkbox" name = "chk1" id ="chk1" onclick = "makeCookie()">

    Then if the checkbox is checked, set the cookie, and read it back in onload of the main page.

    Remember that you need to provide some way of erasing the cookie as otherwise the user cannot change his mind and ask to see the instructions again.

    But personally would prefer a simpler system which gives more control to the user:-

    Code:
    Check this box to see the instructions <input type = "checkbox" name - "chk1" id = "chk1" onclick = "showPop()">
    
    <script type = "text/javascript">
    function showPop() {
    if (document.getElementById("chk1").checked == true) {
    // show the pop-up
    }
    
    }
    </script>
    "I'm such a good lover because I practice a lot on my own." - Woody Allen

  • #3
    Regular Coder howie2009's Avatar
    Join Date
    May 2009
    Location
    Ireland
    Posts
    204
    Thanks
    37
    Thanked 0 Times in 0 Posts
    Thanks will give it a go.
    PS I like the Woody Allen Quote!


  •  

    Posting Permissions

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