Results 1 to 4 of 4
Thread: Future Date Validation
- 05-23-2012, 02:32 PM #1
Member
- Join Date
- May 2012
- Posts
- 2
- Rep Power
- 0
Future Date Validation
Hi All,
I'm trying to get my Validation to check my calendar to ensure that the date being selected from the calendar is a future date.
THe code I am currently using is:
Unfortunatly it only validates the date, and not if the date captured is a future date. Ideally I would like it to check that the date selected is at least 29 days from the current date.Java Code:var dateString = document.form1.date.value; var myDate = new Date(dateString); var today = new Date(); if(document.forms.form1.date.value=="") { alert("Please select a date from the calendar."); document.forms.form1.date.focus(); return false; } else if (myDate<today) { alert("Please select a future date from the calendar."); document.forms.form1.date.focus(); return false; }
Thanks
- 05-23-2012, 02:38 PM #2
Senior Member
- Join Date
- Jun 2007
- Location
- Bali, Indonesia
- Posts
- 696
- Rep Power
- 6
Re: Future Date Validation
This is a Java forum and not a Javascript forum. In fact, Java is to JavaScript as ham is to hamster.
Website: Learn Java by Examples
- 05-23-2012, 02:53 PM #3
Member
- Join Date
- May 2012
- Posts
- 2
- Rep Power
- 0
Re: Future Date Validation
Sorry, I'm pretty much self taught, so still trying to learn what is what. Sorry about that.
- 05-23-2012, 04:58 PM #4
Similar Threads
-
Date Validation
By Gai-Sensei in forum New To JavaReplies: 1Last Post: 02-08-2012, 10:12 PM -
Taking user input as a date and validation!
By Junki3JJC in forum New To JavaReplies: 3Last Post: 03-29-2011, 01:28 PM -
date validation
By droidus in forum New To JavaReplies: 5Last Post: 03-19-2011, 01:37 PM -
License date validation
By thaneshkadi in forum Forum LobbyReplies: 0Last Post: 10-23-2009, 12:26 AM -
Date Validation Script
By Java Tip in forum Java TipReplies: 0Last Post: 01-22-2008, 08:18 PM


LinkBack URL
About LinkBacks

Bookmarks