custom validator

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Aneri
    New Member
    • Feb 2007
    • 11

    custom validator

    My form has a textbox for entering Phone No.How to use custom validator to validate that only numeric value is allowed?
  • ashasprabhu
    New Member
    • Jan 2007
    • 52

    #2
    hi,
    u can use the regular expression validator with
    validation expression property set to [0-9]{3}-[0-9]{4}-[0-9]{6}
    this will give u the format XXX-XXXX-XXXXXX
    if u want alphabets the u can use [a-z]{3}-[0-9]{2}-[A-Z]{3}
    this will give u the format XXX-XX-XXXX with first 3 letters in small letters followed by 2 digit number then followed by 3 captial letters
    hope this helps u
    all the best

    Comment

    • Aneri
      New Member
      • Feb 2007
      • 11

      #3
      Originally posted by ashasprabhu
      hi,
      u can use the regular expression validator with
      validation expression property set to [0-9]{3}-[0-9]{4}-[0-9]{6}
      this will give u the format XXX-XXXX-XXXXXX
      if u want alphabets the u can use [a-z]{3}-[0-9]{2}-[A-Z]{3}
      this will give u the format XXX-XX-XXXX with first 3 letters in small letters followed by 2 digit number then followed by 3 captial letters
      hope this helps u
      all the best


      Thanks.It worked.

      Comment

      Working...