Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Date Validation

Posted on 1998-01-26
1
Medium Priority
?
181 Views
Last Modified: 2013-12-25
I am using ASP forms to enter data into a database. One of the fields is a date field, and I am trying to validate the data being entered is a legal date entry.
0
Comment
Question by:yolish
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 2

Accepted Solution

by:
Jagar earned 200 total points
ID: 1856720
Use the OnSubmit Event of the form that you are using to get the database information.  In that event check the Value of the Textbox that is surposed to hold the date.  You can check this by using the IsDate procedure of VBScript, ie.  If not IsDate(txtDate.Value) then alert "You must enter the date in this field."
If the person doesn't enter a date in the field then you can give them a msgbox and cancel the submission of the form.  Otherwise you can continue with the submission of the form.


Alternate method:  If there is a LostFocus Event for the control then you can check with the IsDate function at this point.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will learn how to dynamically set the form action using jQuery.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

660 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question