letters in a date field

Results 1 to 2 of 2

Thread: letters in a date field

  1. #1
    Join Date
    Dec 1969

    Default letters in a date field

    Hi,<BR><BR>I have 3 fields to put in numbers for a date <BR>(for example: 19 06 2000). But when I put in some letters I get a error, oke that I understand.<BR><BR>But how can you make it so ,that when somebody but in some letters, to get a nice error. For example somebody writes this:<BR>12 k6 2002 and he press the button, that a error appear and say you have typed in the wrong month.<BR><BR>My fields name are: <BR><BR>dateD = Date Day<BR>dateM = Date Month<BR>dateY = Date Year<BR><BR>Thanx allready

  2. #2
    Join Date
    Dec 1969

    Default if you use javascript...

    &#060;script language="JavaScript"&#062;<BR>function Validateform()<BR>{<BR> <BR> if (isNaN(document.form1.field1.value))<BR> {<BR> alert (&#039;Field is not a number&#039;);<BR> return false;<BR> }<BR> else<BR> {return true;}<BR><BR>}<BR>&#060;/script&#062;<BR><BR>&#060;form name="form1" onsubmit="return(Validateform());"&#062;<BR>&#060; input type="text" name="field1"&#062;<BR>&#060;input type="submit" value="submit"&#062;<BR>&#060;/form&#062;<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