Date Validation

Results 1 to 2 of 2

Thread: Date Validation

  1. #1
    Nancy S. Guest

    Default Date Validation

    I hope you can help me. I have a field on an asp form called RequiredDate. I have some JavaScript validation included for some of the fields. For example, I have this script to make sure the user fills in the user name.<BR>function VerifyData()<BR>{<BR> formObj = document.Info;<BR> if (formObj.UserName.value == "")<BR> {<BR> alert ("Please fill in the user&#039s name!");<BR> formObj.UserName.focus();<BR> return false;<BR> }<BR><BR>I would like to make sure the user enters a date 14 days ahead in the RequiredDate field, but I can&#039t seem to find any scripts to do this or figure it out with what I&#039ve found.<BR>Thanks

  2. #2
    Join Date
    Dec 1969
    Posts
    119

    Default RE: Date Validation

    &nbsp;<BR> Hi<BR><BR> i don&#039t know java script but the logic is below...<BR><BR>function VerifyDate()<BR> {<BR> formObj = document.Info;<BR> if (formObj.txtdate.value &#060; "now()+ 14")<BR> {<BR> alert ("Please enter a correct date");<BR> formObj.txtdate.focus();<BR> return false;<BR> }<BR> }<BR><BR>i hope this will help u

Posting Permissions

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