Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
| Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old June 24th, 2005, 08:31 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default Validation for Date of Birth

Code:
<input type="text" size=8 name="dob" STYLE="color: black; font: 7pt Verdana, Arial, Helvetica, sans-serif;">
I have that text box.

How do i put JS Validation on it so that if the date of birth entered checks if the DOB means they are less that two years old?

Check against todays date? Anyone got code for this? Help GREATLY appeciated.

In other words 020304 = true
010290 = false

I.e. if they are over two years old show a JS Alert.

Is this possible?

Picco

www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
www.piccosmini.co.uk.tt
www.morton.uk.tt
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
  #2 (permalink)  
Old June 25th, 2005, 01:25 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hi crmpicco,

In this case u need to provide by what date you are comparing
since if you are using javascript date function to get (current date)today date,you can't get expected result ,.ie. client can change the date setting.

so provide base date using asp/php whtever code,and then compare it to the date entered in the textbox.

Hope this will help you.


Cheers :)

vinod
  #3 (permalink)  
Old June 30th, 2005, 08:13 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

im not sure what you mean? thanks

www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
www.piccosmini.co.uk.tt
www.morton.uk.tt


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code for date of Birth.... aaronabdiel Visual Studio 2005 1 January 2nd, 2008 03:25 AM
Date Validation aftabn10 PHP How-To 0 January 29th, 2007 10:35 AM
Birth Date listings xp_mahesh JSP Basics 0 June 2nd, 2006 12:57 AM
Date of birth question satts Access 10 February 24th, 2005 11:21 AM
validating date of birth in asp shoakat Classic ASP Databases 7 September 3rd, 2004 12:18 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.