Click to See Complete Forum and Search --> : Question re Age Verification script
Macman
08-30-2003, 03:13 PM
I would like combine the very simple Form check box script with a function to have option values entered checked by server to verify that they are equal to a specified age. The date of birth must equal the age of 18. I am very new with javascript but do use a number of them on my web sites and have have made some changes in them that have worked. I just do not have enought knowledge to figure out how to do this. Any help will be appreciated. See attached file
Macman
08-30-2003, 03:26 PM
I would like combine the Form check box script with a function to have option values entered checked by server to verify that they are equal to a specified age. Any help will be appreciated. See attached file:confused:
Nevermore
08-30-2003, 04:04 PM
You don't seem to have attached the file. I can make an age validation thingemy, but are you midway through one that didn't attach?
David Harrison
08-30-2003, 04:19 PM
He posted the same thread twice except that in this one he didn't include the attached file.
I've modified the current script and come up with this, see if this is what you want:
Macman
08-30-2003, 06:07 PM
Thanks loads for the help lavalamp and everybody else.
I checked the script out on my server and it was just what I wanted. I will study what you did and try to understand it. Much thanhks again:)
Macman
08-30-2003, 06:17 PM
I want to thank everyone for the help and responce to my post.
The script posted by lavalamp works very welland was what I wanted but could not figure how to start it.:) :)
Macman
08-30-2003, 06:29 PM
Lavalamp is it possible on that script fixed up for me to send the underage to the exit link automaticaly? In other words the individual is sent to the exit link on a redirect?:)
Macman
08-30-2003, 07:09 PM
I forgot to attach the script file for anyone to look at and comment. What I need to know is can the script be modified to send the surfer if underage to the exit button link, so that they can't try to reenter a new date that would qualify them to enter.:confused:
Macman
08-30-2003, 07:29 PM
I forgot to attach the script file for anyone to look at and comment. What I need to know is can the script be modified to send the surfer if underaged to the exit button link, so that they can't try to reenter a new date that would qualify them to enter. What I don't want is some children 10-17 years old fiqureing out what date they have to enter to get into the site. Perhaps like one try and then they can't reenter from the same IP address maybe.
Khalid Ali
08-31-2003, 06:07 AM
R you nutttts....why are you posting same question so many times????
this is considered extremely impolite and rude. and on top of that it wastes valuable resources of this forum.It took me several minutes to look and merge all of your threads which is a total waste of time,I could have used that time to answer ligit questions on the forum.
Please do not do this.
Thanks
David Harrison
08-31-2003, 08:42 AM
Ok, here is a slightly more advanced Age Detection script.
When the button is pressed it will inform the user of the first error they have made, eg: If they have not selected a year.
If they haven't made any errors it will then check their age, if they are underage it will replace the current URL with a new one so that when they press the back button they will go to the page they were on before yours.
If they have filled in all fields and are old enough the script will check to see if the checkbox has been checked. If it hasn't it will tell them.
If they are old enough and have checked the check box it will take them to your page.
Be aware though that if the user has got JavaScript disabled that when they fill in the form and press submit, it doesn't matter what they entered they will be taken to your page. You could use JavaScript to take them to your page but this means that those without JavaScript can't view your page. Alternatively you can use some server side code to process the form and send them to the right location, this would be the better option because then everybody has access.
Currently I am just setting out in the world of server side coding but I don't yet have the know how to write a script like that yet.
As for cookies, well users can always disable those and again they would need to have JavaScript enabled. Still if you really want to use them I would suggest asking Khalid Ali very politely, I think that he has got a cookie tutorial. I don't really know that much about them so I'm afraid I can't help you there either.
Anyway, here's the script: