date validation

Results 1 to 3 of 3

Thread: date validation

  1. #1
    suresh jeyakumar Guest

    Default date validation

    is there any function in javascript for date validation or i would be thankful if u direct me to some piece of code which i can use for this purpose<BR>thanks<BR>

  2. #2
    G.Narasimha Rao Guest

    Default RE: date validation

    function DateValidation(){<BR>var xt=document.form1["mydate"].value;<BR>var e=0;<BR>if(xt.substring(0,2)&#062;=13 &#124&#124 xt.substring(0,2)&#060;=0){e=1;}<BR>if(xt.substrin g(3,5)&#062;=32 &#124&#124 xt.substring(3,5)&#060;=0){e=1;}<BR>if(xt.substrin g(6,10)&#060;=0){e=1;}<BR>if(xt.substring(2,3)!="/" &#124&#124 xt.substring(5,6)!="/"){e=1;}<BR>if(xt.length&#062;10){e=1}<BR>if (e==1){alert("Please Check Date");<BR>document.form1["mydate"].focus();<BR>return false;<BR>}}

  3. #3
    G.Narasimha Rao(rao@coolc Guest

    Default RE: date validation

    function DateValidation(){<BR>var xt=document.form1["mydate"].value;<BR>var e=0;<BR>if(xt.substring(0,2)&#062;=13 &#124&#124 xt.substring(0,2)&#060;=0){e=1;}<BR>if(xt.substrin g(3,5)&#062;=32 &#124&#124 xt.substring(3,5)&#060;=0){e=1;}<BR>if(xt.substrin g(6,10)&#060;=0){e=1;}<BR>if(xt.substring(2,3)!="/" &#124&#124 xt.substring(5,6)!="/"){e=1;}<BR>if(xt.length&#062;10){e=1}<BR>if (e==1){alert("Please Check Date");<BR>document.form1["mydate"].focus();<BR>return false;<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
  •