Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. date validation in javascript

date validation in javascript

Scheduled Pinned Locked Moved ASP.NET
javascript
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sra22
    wrote on last edited by
    #1

    hi, I want to create date validation in client side using javascript i.e to display invalid date(checking all months & dates).I have searched in google & tried some of them ,but it doesn't work. can anyone send the solution for this Thanks in advance

    V V 2 Replies Last reply
    0
    • S sra22

      hi, I want to create date validation in client side using javascript i.e to display invalid date(checking all months & dates).I have searched in google & tried some of them ,but it doesn't work. can anyone send the solution for this Thanks in advance

      V Offline
      V Offline
      varshavmane
      wrote on last edited by
      #2

      Y dont u use date picker of javascript???if u dont get any code related to this then I will give u.

      S 1 Reply Last reply
      0
      • V varshavmane

        Y dont u use date picker of javascript???if u dont get any code related to this then I will give u.

        S Offline
        S Offline
        sra22
        wrote on last edited by
        #3

        ok.give that code

        J 1 Reply Last reply
        0
        • S sra22

          ok.give that code

          J Offline
          J Offline
          just3ala2
          wrote on last edited by
          #4

          This is a good calendar control find the framework suitable version if this doesn't suit u :) http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=FED8B3BE-67E2-4BFC-BE34-404799B17D77[^]

          Best Regards 3ala2 :)

          1 Reply Last reply
          0
          • S sra22

            hi, I want to create date validation in client side using javascript i.e to display invalid date(checking all months & dates).I have searched in google & tried some of them ,but it doesn't work. can anyone send the solution for this Thanks in advance

            V Offline
            V Offline
            Vinay Dornala
            wrote on last edited by
            #5

            hi see this script and check it once function valDateRng(daterng) { myOption = -1; for (i=0; i 0) {result += fld.charAt(i); if (fld.charAt(i) != " ") c = result.length;}}return result.substr(0,c);} var numb = '0123456789'; function isValid(parm,val) {if (parm == "") return true; for (i=0; i -1) dd = dd.substr(0,n); n = dd.lastIndexOf('nd'); if (n > -1) dd = dd.substr(0,n); n = dd.lastIndexOf('rd'); if (n > -1) dd = dd.substr(0,n); n = dd.lastIndexOf('th'); if (n > -1) dd = dd.substr(0,n); n = dd.lastIndexOf(','); if (n > -1) dd = dd.substr(0,n); n = mm.lastIndexOf(','); if (n > -1) mm = mm.substr(0,n); if (!isNum(dd)) return false; if (!isNum(yy)) return false; if (!isNum(mm)) { var nn = mm.toLowerCase(); for (var i=1; i < 13; i++) { if (nn == mth[i] || nn == mth[i].substr(0,3)) {mm = i; i = 13;} } } if (!isNum(mm)) return false; dd = parseFloat(dd); mm = parseFloat(mm); yy = parseFloat(yy); if (yy < 100) yy += 2000; if (yy < 1582 || yy > 4881) return false; if (mm == 2 && (yy%400 == 0 || (yy%4 == 0 && yy%100 != 0))) day[mm-1]++; if (mm < 1 || mm > 12) return false; if (dd < 1 || dd > day[mm-1]) return false; t.setDate(dd); t.setMonth(mm-1); t.setFullYear(yy); if (rng == 'p' || rng == 'P') { if (t > today) return false; } else if (rng == 'f' || rng == 'F') { if (t < today) return false; } else if (rng != 'a'

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups