Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Validation

Status
Not open for further replies.

hayley

Programmer
Mar 14, 2001
13
GB
Hi,

I'm new to VBScript and was wondering if anyone could help with a query I have.

I have a web page in asp where the user inputs a start date and an end date in html input boxes. I would like the dates to default to, and display, the present date (in the format dd/mm/yyyy) and also include code to check that the dates entered are valid. Can anyone help?

Thanks very much!
 
hey guy

To set your dates default to the current date use
<input id=YourtextboxId name=YourTextboxname Value=&quot;<%=now%>&quot;> (HTML CODE)
the &quot;now&quot; command will put the current date into the text box.

to validate the date that is in the text box.Use.
Mydate= Request.Form(&quot;The Name of Your TextBox where you enter your date&quot;)
if IsDate(MyDate)then
do what ever
else
Error Message
end if
this is all done in vbscript.

I hope this helps



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top