programmingsite : code , tutorials and scripts
Navigation

home


ASP
ASP.net
C
C++
C#
PHP
Java
JavaScript
Powershell
VB.net

Visual Basic


Resources
code
tutorials
training

Ads
Products

 

 

Check if a date is valid





Check if a date is valid

This example displays a form on a page . The user then enters a date , if the date is invalid then a message will be displayed on the screen . Examples of valid dates are as follows

12-12-03
12/12/03


<form method ="post" action="<%= Request.ServerVariables("SCRIPT_NAME") %>">
<input type ="text" name="date"><br>
<input type="submit">
</form>
<%
Dim strDate , blnValid , dteDate
If Request.ServerVariables("CONTENT_LENGTH") <>0 Then
strDate = Trim(Request.Form("date"))
'check and see if the user entry is a date
If isDate(strDate) Then
dteDate = CDate(strDate)
'set variable to true
blnValid = True
Else
'display invalid date message
Response.Write "You entered an invalid date"
End If
'displayvalid date message
If blnValid = True Then
Response.Write "The date you entered was " & dteDate
End If
End If
%>





Products
500 Java Tips E-book
PHP editor
PERL editor
Beginning Java
Beginning Visual Basic
Learn VB.net
Learn VB 6
VB and databases
ASP image library
C++ builder programming
C++ fundamentals
Asp Studio 2005
Xtra PHP
Online PHP Script Encoder
Comparison

Links
Make money selling software
Uk shopping
UK price comparison
US price comparison
free articles
free stuff
Gambling resources
Software directory
XBox cheats and more
Sexy free wallpapers
Hosting resources
Nintendo Wii info
Beginners PHP
Health and fitness
Domain names
Dating site
Nintendo DS resources
Dropshippers
Maxi directory
Perfume and fragrances
PC shopping, tips and info
Magazine superstore

Ads