expression validator

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cmrhema
    Contributor
    • Jan 2007
    • 375

    expression validator

    Hello
    I am using a text box where I want the user should input only alpha numeric values.
    I tried to used regular expression validator
    In the validation expression I wrote a-z,A-Z,0-9
    But it does not work

    Where am I wrong
    regards
    cmrhema
  • hbxtlhx
    New Member
    • Sep 2007
    • 10

    #2
    int.TryParse()

    or decimal.TryPars e()
    ...

    Comment

    • krris
      New Member
      • May 2007
      • 10

      #3
      Hi,
      Try This

      ^[a-zA-z0-9]*$

      Comment

      • rohitbce
        New Member
        • Aug 2007
        • 30

        #4
        Hi
        you are going write way but doing a little bit mistak
        use like that
        ^[a-zA-Z0-0]*

        Thanks and Regards,
        Rohit Jain - s/w Developer

        Comment

        • cmrhema
          Contributor
          • Jan 2007
          • 375

          #5
          Originally posted by rohitbce
          Hi
          you are going write way but doing a little bit mistak
          use like that
          ^[a-zA-Z0-0]*

          Thanks and Regards,
          Rohit Jain - s/w Developer
          Thanks Rohit
          I have changed it to
          ^[a-zA-Z0-9]{8,8}$

          So now the textbox will be vaildated for alphanumeric values also the length of the password should be only 8(neither more nor less)

          One more question while browsing many a websites, I have noticed that when the user inserts any character(non alphabet and non numeric such as *,,>% etc)
          It displays * not allowed.

          for eg i have keyed in a * than it would prompt * not allowed
          if i keyed in % than it would prompt % not allowed

          Any idea what kind of validator should i use and where

          Regards
          hema

          Comment

          • kenobewan
            Recognized Expert Specialist
            • Dec 2006
            • 4871

            #6
            Have you tried javascript?

            Comment

            Working...