Solved

Date Validation

Posted on 1998-01-26
1
159 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
1 Comment
 
LVL 2

Accepted Solution

by:
Jagar earned 50 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

708 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now