Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Aug 2006
    Location
    connecticut USA
    Posts
    54

    Looking for accept terms Java script

    I need a java script that will have a dialoge box appear before one can view a web page. Something similar to what the adult sites use making the person acknowledge they are 18 or agree to the terms of the site before viewing a page. I think this type of script would also set a cookie so the user would not have to click ok everytime they enter a restricted area. I perfer not to use a redirect script unless this is the most common way of doing this.

  2. #2
    Administrator Dave's Avatar
    Join Date
    Sep 2004
    Location
    Te Awamutu, New Zealand
    Posts
    3,959
    Blog Entries
    79
    Try www.scriptsearch.com or www.hotscripts.com.

    If you can live without the cookie, it would be easy to make a JavaScipt script to do this. Just use a confirm dialogue box like so:

    Code:
    <SCRIPT type="text/javascript">
    if (confirm("Are you 18?") )
    {
    parent.location='http://www.example.com/enter.html';
    } else {
    parent.location='http://www.example.com/exit.html';
    }
    </SCRIPT>
    Dave Owen
    MediaCollege.com

  3. #3
    New Member
    Join Date
    Nov 2006
    Location
    Louisville, KY
    Posts
    1
    This works except for the fact that returning to the page with the back button produces a never ending hourglass.

    http://shoprag.com/redirect.htm

    How can I stop that from happening?

  4. #4
    Member
    Join Date
    Aug 2006
    Location
    connecticut USA
    Posts
    54
    This script I found will verify by age and allow entrance to a site by setting a cookie. The main.js is embedded in all pages to see if the cookie is there and the index.js is embedded in a disclaimer page which will allow access or not to all other pages depending on the answer to the age question. I found this easy to implement and it works great.

    Once the vistor answers the questions correctly they never have to go through the disclaimer page again.

    For your purpose though it seems you need it to just agree to the terms. I would think with a little tweeking it could be changed to do just that. If anyone can adjust the script to accomplish this please let me know, I would be interested in having it work that way myself.
    Attached Files Attached Files

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Subscribe to us on YouTube