Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default Age Restriction...

    Ok, I'm currently looking to apply some sort of 'age restriction' to my website. By this I mean that people will have to be over 18 to create an account.

    Is this possible?

    I've had a quick search of the forums, but not found an answer... yet.

    Any advice welcome.

  2. #2
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

    Default Re: Age Restriction...

    Since the DOB is one of the fields on the registration form, I would guess that you could write some sort of routine could check the age and make sure it is >18.

    I'm not a coder so I can't offer anything further on this.

    Maybe one of the DEV's has an answer.

  3. #3
    Join Date
    Mar 2006
    Posts
    919
    Plugin Contributions
    2

    Default Re: Age Restriction...

    Thanks for the reply.

    I was thinking of writting some sort of field validation code, but didn't want to waste any time if ZenCart already catered for my needs (or if a contribution was available).

  4. #4
    Join Date
    Feb 2006
    Location
    Chicago
    Posts
    1,162
    Plugin Contributions
    0

    Default Re: Age Restriction...

    I tried editing the \includes\modules\pages\login\jscript_form_check.php

    Any idea why this code wont show the value of DOB entered by user?

    Code:
    //CODE ADDED
    function check_age(field_name, field_age, message)
    {
    	var today =new Date;
    	//var enteredDate=field_name;
    	//alert("form.elements[field_name]");
    	var TestVar = form.elements[field_name];
    	alert ("You typed: " + TestVar);
    	if ((today.getTime() - form.elements[field_name]) < 10)
    	{
    //	alert("Wow");
    	}
    }
    All it says is
    You typed: object HTMLInput Element
    Thanks
    San
    Tutorials on Zen Cart
    http://tutorials.zen-cart.com/index.php
    ---------------
    advanced.programmer at gmail dot com
    In love with Zen Cart!!

  5. #5
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

    Default Re: Age Restriction...

    If you are just loging in you don't need a dob because you're already registered and just require an e-mail address and password.

    Try your code in pages -> create_account -> jscript_form_check.php

  6. #6
    Join Date
    Feb 2006
    Location
    Chicago
    Posts
    1,162
    Plugin Contributions
    0

    Default Re: Age Restriction...

    Quote Originally Posted by clydejones
    If you are just loging in you don't need a dob because you're already registered and just require an e-mail address and password.

    Try your code in pages -> create_account -> jscript_form_check.php
    Fine, but when you say login and fill fields etc for account registration and say Submit the file which gets called is jscript_form_check.php placed in pages/login
    Tutorials on Zen Cart
    http://tutorials.zen-cart.com/index.php
    ---------------
    advanced.programmer at gmail dot com
    In love with Zen Cart!!

  7. #7
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

    Default Re: Age Restriction...

    That file is also located in the create_account folder.

    When you create an account (register) then and click submit the file getting called is in pages -> create_account

    When you login and click the login button the file getting called is pages -> login

    Although Login and Create Account appear on the same page they are actually handled by two different forms.

 

 

Similar Threads

  1. Age restriction
    By dereck72 in forum General Questions
    Replies: 5
    Last Post: 20 Dec 2013, 04:25 PM
  2. Age Restriction Page
    By LovejonesBoutique in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 10 Nov 2010, 09:59 AM
  3. Age Verification or Restriction
    By Sweet ZouZou in forum General Questions
    Replies: 15
    Last Post: 10 Nov 2010, 09:46 AM
  4. Age Restriction
    By darkmarauder in forum Managing Customers and Orders
    Replies: 2
    Last Post: 20 Sep 2010, 12:18 PM
  5. Login Age Restriction
    By MIJewels in forum Managing Customers and Orders
    Replies: 0
    Last Post: 14 Apr 2008, 06:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg