How to define custom mask on number field limiting the value entered to 255.

Version 1

    Details

     

    How to define custom mask to limit a number field. For example how can we define that the value should be between 0 and 255?

     


    Resolution

    This can be accomplished by:
    1.  Create a number field of Digits 3, Precision 0.



    2.  Add the field to the form and set a custom mask of 999 (this will restrict the user from entering 4 or more characters and getting error).


    3.  Add a Regular Expression Validation Rule with the following expression:
    ^([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$


    Also reference the following for more information on using Regular Expression to limit numeric field value: