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. Validation of textbox control in a datagrid

Validation of textbox control in a datagrid

Scheduled Pinned Locked Moved ASP.NET
javascripthelp
5 Posts 2 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.
  • Z Offline
    Z Offline
    zareee
    wrote on last edited by
    #1

    hi , I use datagrid with textbox control.I need a javascript validation for the textbox that should allow numeric values with a single decimal point. Maximum numeric value it can allow is 999999.99999 Can ne body help ASAP Thanx in advance,

    zari

    S 1 Reply Last reply
    0
    • Z zareee

      hi , I use datagrid with textbox control.I need a javascript validation for the textbox that should allow numeric values with a single decimal point. Maximum numeric value it can allow is 999999.99999 Can ne body help ASAP Thanx in advance,

      zari

      S Offline
      S Offline
      SathyaSiva
      wrote on last edited by
      #2

      function KeyCheck(e) { //With FireFox Support var KeyID = (window.event) ? event.keyCode : e.which; //a-z if((KeyID >= 65 && KeyID <= 90) || (KeyID >= 97 && KeyID <= 122) || (KeyID >= 33 && KeyID <= 47) || (KeyID >= 58 && KeyID <= 64) || (KeyID >= 91 && KeyID <= 96) || (KeyID >= 123 && KeyID <= 126) || (KeyID==32)) { return false; } return true; } and call this fn onkeypress="return KeyCheck(event);" like this

      Sathya

      Z 1 Reply Last reply
      0
      • S SathyaSiva

        function KeyCheck(e) { //With FireFox Support var KeyID = (window.event) ? event.keyCode : e.which; //a-z if((KeyID >= 65 && KeyID <= 90) || (KeyID >= 97 && KeyID <= 122) || (KeyID >= 33 && KeyID <= 47) || (KeyID >= 58 && KeyID <= 64) || (KeyID >= 91 && KeyID <= 96) || (KeyID >= 123 && KeyID <= 126) || (KeyID==32)) { return false; } return true; } and call this fn onkeypress="return KeyCheck(event);" like this

        Sathya

        Z Offline
        Z Offline
        zareee
        wrote on last edited by
        #3

        It works fine with numbers... but it does not accept decimal point.I want to have only one decimal point.ne solution for this

        zari

        S 1 Reply Last reply
        0
        • Z zareee

          It works fine with numbers... but it does not accept decimal point.I want to have only one decimal point.ne solution for this

          zari

          S Offline
          S Offline
          SathyaSiva
          wrote on last edited by
          #4

          In that script itself check (.) Ascii value also

          Sathya

          Z 1 Reply Last reply
          0
          • S SathyaSiva

            In that script itself check (.) Ascii value also

            Sathya

            Z Offline
            Z Offline
            zareee
            wrote on last edited by
            #5

            Yeah i have checked the ascii value of ".".Its working but how to restrict the user from entering more than one decimal point... say it should allow 123.45678 n not 123**.45.67 and also not 123..**45

            zari

            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