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 5 of 5
  1. #1
    Regular Coder
    Join Date
    Feb 2006
    Posts
    168
    Thanks
    32
    Thanked 1 Time in 1 Post

    really been looking for a jquery solution. 21 or over age verification script

    hello guys,

    First id like to say that I truly appreciate any help or resources that can be shown to me here. because of you all, i am learning, not just grabbing code. I want to learn. I have though been stuck at finding what I need. I am doing a very basic site for a local liquor company that simply requires that the visitor can only enter if they say they are 21 years old. I mean a simple yes or no script is fine but they want a script where the must select their year of birth and it computes that they are 21, it will send them to a welcome page. if not, it will send them to an alternate page. I guess cookies would be involved too. if they try to jump pages it will kick them back to the verification page until they manually verify their age.

    Have any of you worked on anything similar and possibly can help? Iv already look at this one but it isn't really what I need. http://www.techerator.com/2010/09/ho...s-mmm-cookies/

    Id honestly appreciate any help.

    Thanks in advance.

  • #2
    Gütkodierer
    Join Date
    Apr 2009
    Posts
    2,127
    Thanks
    1
    Thanked 426 Times in 424 Posts
    As the article you linked to mentions, a server side solution is preferable if it's important to you that all users get to see the age check.

    Anyway, if I understand you correctly, your problem is that you don't know how to use a year of birth selector to calculate the current age? First of all, that's pretty flawed. If you're not letting users enter their actual birthday, but only a year, you have to choose between either keeping some 21-year-olds out or letting some 20-year-olds in.

    If you still want to do it that way, all you need to know about is Date objects: https://developer.mozilla.org/en/Jav...l_Objects/Date
    .My new Javascript tutorial site: http://reallifejs.com/
    .Latest article: Calculators — Tiny jQuery calculator, Full-fledged OOP calculator, Big number calculator
    .Latest quick-bit: Including jQuery — Environment-aware minification and CDNs with local fallback

  • #3
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    what server side language do you have available?

  • #4
    New to the CF scene
    Join Date
    Oct 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    if you're really serious about age verification and want to go further than the lame "tick the box to say you're 21" approach then there are companies like 192business and Idology who offer an age verification API that actually checks customer age & ID during sign-up. How much traffic that keeps out is another question entirely...

  • #5
    New to the CF scene
    Join Date
    Nov 2011
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Isn't the only requirement to legally cover the arse of the site owner? I mean, anyone who wants in is going to click whatever is necessary to get in.
    I would have thought a simple, 'click this if you are over 21' button, which will either allow entry or redirect to a 'sorry' page, would be all that's required, without having to calculate the age of the visitor based on whatever they choose to enter as their date of birth.
    I would think something like what's demonstrated here or here would do that.


  •  

    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
    •