insert date!

Results 1 to 2 of 2

Thread: insert date!

  1. #1
    Join Date
    Dec 1969

    Default insert date!

    i qant user input the date in the text box "10/07/2000" , if they insert the wrong data means "abc4/21" not the date then pop up the error message say taht "wrong date" but in my code it didn&#039t work ! what is miss out ?<BR><BR><BR>&#060;Form action="time.asp" Method=Post&#062;<BR>please type the date : <BR>&#060;input type="text" name="time"&#062;<BR><BR>&#060;input type="submit" name="Submit"&#062;<BR>&#060;input type="reset" name="Reset"&#062;<BR>&#060;/form&#062;<BR><BR><BR>&#060;% <BR><BR>strtime = request.form("time")<BR><BR>if strtime=date then<BR>Response.Write "your insert the correct date " <BR><BR>else<BR>Response.Write "insert incorrect"<BR><BR>end if<BR><BR>%&#062;<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: insert date!

    You need to use IsDate<BR><BR>So code would like this<BR><BR>If IsDate(strTime) then<BR> Response.write "Correct Date<BR>Else<BR> Response.write "Incorrect Date"<BR>End If<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts