|
Subroutines - Choosing/Validating
Dates #2 by Charles Carroll
The form handler for the previous example could validate and
manipulate dates using some built-in VBscript date handling routines, for example:
- isdate() to validate a date
filename=/learn/test/subdatesrespond.asp
<HEAD><TITLE>subdatesrespond.asp</TITLE></HEAD>
<HTML><body bgcolor="#FFFFFF">
<%
dday=request.querystring("departday")
dmonth=request.querystring("departmonth")
dyear=request.querystring("departyear")
departdate=dday & "/" & dmonth & "/" & dyear
aday=request.querystring("arriveday")
amonth=request.querystring("arrivemonth")
ayear=request.querystring("arriveyear")
arrivedate=aday & "/" & amonth & "/" & ayear
If isdate(departdate) then
response.write "Departure Date is Valid Date<br>"
else
response.write "Departure Date is INVALID<br>"
end if
If isdate(arrivedate) then
response.write "Arrival Date is Valid Date<br>"
else
response.write "Arrival Date is INVALID<br>"
end if
%>
</BODY></HTML>
 |  |  |
 |
There are many worthy charities!!. But perhaps help starving children in Africa or South America AND help Charles too.
a $5 tip buys him lunch at McDonalds,
a $20 tip buys his kid Hitoshi a new computer game,
a $39 tip buys his daughter Michiko a few nice outfits.
See our donor list.
|  |
 |  |  |
|
|
|
|