Solved

Date Validation

Posted on 1998-01-26
1
171 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 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

Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Understanding UserAgent String 2 70
ASP.NET data base connection 35 95
WordPress:  Reset File Permission after server migration 5 65
Natural height and jquery 6 41
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

710 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