www.webdeveloper.com
Results 1 to 4 of 4

Thread: javascript age verification age...

  1. #1
    Join Date
    Mar 2011
    Posts
    22

    Talking javascript age verification age...

    can any one send me some age verfication code links?. thanks a lot!

  2. #2
    Join Date
    Sep 2009
    Posts
    163
    http://www.kuranes.co.uk/utils/agecheck.html


    go to this link and then press "ctrl+U"
    you will get the source code for age verification .

  3. #3
    Join Date
    Dec 2002
    Location
    St. Louis, MO, USA
    Posts
    1,582
    Quote Originally Posted by developerguru View Post
    http://www.kuranes.co.uk/utils/agecheck.html


    go to this link and then press "ctrl+U"
    you will get the source code for age verification .
    CTRL-U doesn't work in IE (sadly, the most commonly used browser.)

  4. #4
    Join Date
    Feb 2006
    Posts
    2,927
    Code:
    //
    function agefromDob(dob){
    	var now= new Date, s= 'Please enter date of birth as ',
    	ddmm= Date.parse('2/6/2009')> Date.parse('6/2/2009');
    	if(ddmm) s+= 'date. month and year:\n\t"31 January,1992" or "31/1/1992"';
    	else s+= 'month, date and year:\n\t"January 31,1992" or "1/31/1992"';
    	while(!Date.parse(dob)){
    		dob= prompt(s, '');
    		if(dob== undefined) return '';
    	}
    	dob= new Date(Date.parse(dob));
    	now.setHours(0, 0, 0, 0);
    	now= [now.getFullYear(), now.getMonth(), now.getDate()];
    	dob= [dob.getFullYear(), dob.getMonth(), dob.getDate()];
    	if(dob[2]> now[2]) dob[1]+= 1;
    	if(dob[1]> now[1])dob[0]+= 1;
    	return now[0]-dob[0];
    }
    //agefromDob("January 1,1992")
    //agefromDob()
    Last edited by mrhoo; 03-21-2011 at 10:17 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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
  •  
HTML5 Development Center



Recent Articles