Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-18-2011, 10:02 PM   PM User | #1
gribbs100
Regular Coder

 
Join Date: Feb 2006
Posts: 168
Thanks: 32
Thanked 1 Time in 1 Post
gribbs100 is an unknown quantity at this point
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.
gribbs100 is offline   Reply With Quote
Old 10-19-2011, 12:00 PM   PM User | #2
venegal
Gütkodierer


 
Join Date: Apr 2009
Posts: 2,127
Thanks: 1
Thanked 426 Times in 424 Posts
venegal has a spectacular aura aboutvenegal has a spectacular aura about
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
venegal is offline   Reply With Quote
Old 10-19-2011, 01:10 PM   PM User | #3
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,337
Thanks: 13
Thanked 207 Times in 207 Posts
DanInMa is on a distinguished road
what server side language do you have available?
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users
DanInMa is offline   Reply With Quote
Old 10-21-2011, 02:24 PM   PM User | #4
ZXSpectrum
New to the CF scene

 
Join Date: Oct 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
ZXSpectrum is an unknown quantity at this point
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...
ZXSpectrum is offline   Reply With Quote
Old 11-29-2011, 02:35 PM   PM User | #5
ofnonation
New to the CF scene

 
Join Date: Nov 2011
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
ofnonation is an unknown quantity at this point
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.
ofnonation is offline   Reply With Quote
Reply

Bookmarks

Tags
age verification, cookie, jquery, script

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:00 PM.


Advertisement
Log in to turn off these ads.