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. Allowing only character values in Textboxes

Allowing only character values in Textboxes

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nethelp
10 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.
  • R Offline
    R Offline
    Rajiya
    wrote on last edited by
    #1

    hi, Can anyone plz suggest me sum code which will allow me to enter only character values in my Textboxes for an ASP.Net page. For e.g. if i have a textbox which inputs name, it shld not allow me to enter numbers in it. I am using ASP.Net and C# for Coding. Help me plz. Regards, Riz

    V A A 3 Replies Last reply
    0
    • R Rajiya

      hi, Can anyone plz suggest me sum code which will allow me to enter only character values in my Textboxes for an ASP.Net page. For e.g. if i have a textbox which inputs name, it shld not allow me to enter numbers in it. I am using ASP.Net and C# for Coding. Help me plz. Regards, Riz

      V Offline
      V Offline
      Vasudevan Deepak Kumar
      wrote on last edited by
      #2

      You can have a onKeyUp event handler and check for the Ascii code of the keys. Vasudevan Deepak Kumar Personal Web: http://www.lavanyadeepak.tk/ I Blog At: http://www.dotnetjunkies.com/weblog/deepak/
      http://deepakvasudevan.blogspot.com/
      http://deepak.blogdrive.com/

      R 1 Reply Last reply
      0
      • V Vasudevan Deepak Kumar

        You can have a onKeyUp event handler and check for the Ascii code of the keys. Vasudevan Deepak Kumar Personal Web: http://www.lavanyadeepak.tk/ I Blog At: http://www.dotnetjunkies.com/weblog/deepak/
        http://deepakvasudevan.blogspot.com/
        http://deepak.blogdrive.com/

        R Offline
        R Offline
        Rajiya
        wrote on last edited by
        #3

        hi, If you have any code for that then plz send it to me. Waiting for ur help. Regards, riz

        V 1 Reply Last reply
        0
        • R Rajiya

          hi, Can anyone plz suggest me sum code which will allow me to enter only character values in my Textboxes for an ASP.Net page. For e.g. if i have a textbox which inputs name, it shld not allow me to enter numbers in it. I am using ASP.Net and C# for Coding. Help me plz. Regards, Riz

          A Offline
          A Offline
          albCode
          wrote on last edited by
          #4

          this article checks the date format and it is good example for ur request. http://www.codeproject.com/useritems/txtDate.asp hope helps

          1 Reply Last reply
          0
          • R Rajiya

            hi, If you have any code for that then plz send it to me. Waiting for ur help. Regards, riz

            V Offline
            V Offline
            Vasudevan Deepak Kumar
            wrote on last edited by
            #5

            http://javascript.internet.com/forms/dfilter.html[^] Vasudevan Deepak Kumar Personal Web: http://www.lavanyadeepak.tk/ I Blog At: http://www.dotnetjunkies.com/weblog/deepak/
            http://deepakvasudevan.blogspot.com/
            http://deepak.blogdrive.com/

            1 Reply Last reply
            0
            • R Rajiya

              hi, Can anyone plz suggest me sum code which will allow me to enter only character values in my Textboxes for an ASP.Net page. For e.g. if i have a textbox which inputs name, it shld not allow me to enter numbers in it. I am using ASP.Net and C# for Coding. Help me plz. Regards, Riz

              A Offline
              A Offline
              Arkett
              wrote on last edited by
              #6

              Why Not just use a regular expression validator on the page with the text box you want to control. End of Line.

              A R 2 Replies Last reply
              0
              • A Arkett

                Why Not just use a regular expression validator on the page with the text box you want to control. End of Line.

                A Offline
                A Offline
                albCode
                wrote on last edited by
                #7

                That's great component and great solution for him

                1 Reply Last reply
                0
                • A Arkett

                  Why Not just use a regular expression validator on the page with the text box you want to control. End of Line.

                  R Offline
                  R Offline
                  Rajiya
                  wrote on last edited by
                  #8

                  hi, Am new to ASP.Net and still learning it.So could u plz provide me with the code which allows me to enter only String or characters in a Textbox and will not allow any numeric values in it. I think this can be achieved using Javascript but dont knw how to do it. Plz help me. Regards, Riz

                  A 1 Reply Last reply
                  0
                  • R Rajiya

                    hi, Am new to ASP.Net and still learning it.So could u plz provide me with the code which allows me to enter only String or characters in a Textbox and will not allow any numeric values in it. I think this can be achieved using Javascript but dont knw how to do it. Plz help me. Regards, Riz

                    A Offline
                    A Offline
                    Arkett
                    wrote on last edited by
                    #9

                    Drag a regular expression validator from the toolbox onto the page containing the textbox to validate. In the properties panel find the regular expression property and type [a-zA-Z] in the controlToValidate property set the textbox id from the dropdown list. if you want to include spaces as well alpha characters the expression will be /s[a-zA-Z] including the square brackets. for a full and detailed explanation of regular expressions see.. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconCOMRegularExpressions.asp http://www.ViSYNERGY.com End of Line.

                    R 1 Reply Last reply
                    0
                    • A Arkett

                      Drag a regular expression validator from the toolbox onto the page containing the textbox to validate. In the properties panel find the regular expression property and type [a-zA-Z] in the controlToValidate property set the textbox id from the dropdown list. if you want to include spaces as well alpha characters the expression will be /s[a-zA-Z] including the square brackets. for a full and detailed explanation of regular expressions see.. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconCOMRegularExpressions.asp http://www.ViSYNERGY.com End of Line.

                      R Offline
                      R Offline
                      Rajiya
                      wrote on last edited by
                      #10

                      hi, You had specified that: In the properties panel find the regular expression property and type [a-zA-Z]. But i cant find any regular expression property. Where do i have to type [a-zA-Z]? I got the controlToValidate property.Please guide me on this point. Thanks a lot.

                      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