Releated DesktopBased for validation code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jitendraimrb
    New Member
    • May 2014
    • 1

    Releated DesktopBased for validation code

    I have given a text box where when i press number key it should validate for number should accept only for Char digit,
    so what will validation code ?
  • chaarmann
    Recognized Expert Contributor
    • Nov 2007
    • 785

    #2
    Just get the key pressed as char and test that it lies between >='0' and <='9'.
    That is the validation code for a positive 1-digit natural number.
    What else do you want to test for?
    • numbers with more than one digit
    • leading zeros
    • minus sign
    • floating point numbers
    • exponent indicator
    • complex numbers

    Comment

    Working...