Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 10th, 2005, 5:38 PM   #1
Pseudo Class
Newbie
 
Pseudo Class's Avatar
 
Join Date: Dec 2004
Posts: 26
Rep Power: 0 Pseudo Class is on a distinguished road
Must be 18 to register

I need to make a script using javascript that makes an alert saying " You must be 18 to register" if the birthday that entered shows that they are under 18. This may seem easy for other people but Javascript isn't my best subject. If someone can point me in the right direction, it would be greatly appreciated.
Pseudo Class is offline   Reply With Quote
Old Jan 10th, 2005, 5:54 PM   #2
uman
Expert Programmer
 
Join Date: Dec 2004
Posts: 794
Rep Power: 4 uman is on a distinguished road
I don't do any JavaScript (at all) but I can point you to w3schools.com for all your JavaScript (and other Web Development) learning needs.

There was probably a similar thing when you registered for this very forum. Go to some message boards and go through the registration process, then do view source when you are at the point where it asks you your age. This will shed some light on how the professionals do it.
uman is offline   Reply With Quote
Old Jan 10th, 2005, 10:10 PM   #3
kurifu
Expert Programmer
 
kurifu's Avatar
 
Join Date: Jul 2004
Location: Halifax, Nova Scotia (Canada)
Posts: 784
Rep Power: 5 kurifu is on a distinguished road
Send a message via ICQ to kurifu Send a message via MSN to kurifu
Thanks for the link man, actually it iwill be useful for even me
__________________
Clifford Matthew Roche <geek@cliffordroche.com>
Web Hosting: http://www.crd-hosting.com
Consulting: http://www.crdev-consulting.com
kurifu is offline   Reply With Quote
Old Jan 10th, 2005, 10:21 PM   #4
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
Theres no good way to do it in JS, JS requires their system time to be correct, use a server side language like PHP or ASP my friend...
__________________

tempest is offline   Reply With Quote
Old Jan 11th, 2005, 11:56 AM   #5
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
He's right ya know. I suggest doing both actually - the JavaScript will stop them from making a mistake (if it is a mistake), and the PHP will stop anyone (with the wrong system time or disabled JavaScript) from getting through.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Jan 11th, 2005, 11:57 AM   #6
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
Indeed. They are right. that's how i'd to it.
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote
Old Jan 11th, 2005, 4:36 PM   #7
Pseudo Class
Newbie
 
Pseudo Class's Avatar
 
Join Date: Dec 2004
Posts: 26
Rep Power: 0 Pseudo Class is on a distinguished road
If I could do with it PHP i would do it in an instance but i'm doing it for someone who doesn't have access to there server. It's one of those sites that gives out freeforums. That's why i'm required to do it in Javascript.
Pseudo Class is offline   Reply With Quote
Old Jan 11th, 2005, 5:45 PM   #8
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Fair enough. If people want to get in, they'll just change their DOB anyway.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Jan 11th, 2005, 10:35 PM   #9
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
Do it this way, have a remotely linked JS file set variables for system time from your home server and then write the JS code for 18 auth....

HTML:
<script src="http://my.website.wherever.com/scripts/currentTime.js">

currentTime.js:
<?php
    echo "var month = " . date("m") . ";\n"
    echo "var day = " . date("d") . ";\n"
    echo "var year = " . date("y") . ";\n"
?>
__________________

tempest is offline   Reply With Quote
Old Jan 12th, 2005, 5:52 PM   #10
Pseudo Class
Newbie
 
Pseudo Class's Avatar
 
Join Date: Dec 2004
Posts: 26
Rep Power: 0 Pseudo Class is on a distinguished road
Thank you tempest = D
Pseudo Class is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:33 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC