Input Masking

Hi,

We would like to validate/restrict the user inputs to a particular style.
For example, I have a decimal number and would like to restrict the user
input to a single decimal place. How do we achieve this? Is masking like:
99.9 is available? If yes, how do I use it?

Thanks & Regards,
Jeffrey

Jeffrey,

We currently only support regular expression matching WRT masking.

You can use a regular expression in the form

constraint="regex(., '[1]*.[0-9]$')"

which would require N initial digits, and 1 decimal point. If you want to
do so:

A) You should specify that the input type is a string (not a number), and
then add appearance="numeric" to your question. Our engine treats
numbers as numbers, so the string representation of "23.6" could be "23.6"
or "23.60000" or "2.36e1". If you specify that the value is a string, the
engine will retain the specific digits entered, and the "numeric"
appearance will restrict the input to only allowing digits and "."s, etc.

B) Since regex matching is difficult, the app won't be able to help out at
all with restricting the input at the point of entry like it would if you
used something like ". < 100000" (in this case the app wouldn't let you
enter more than 5 digits), so it will be important to ensure that
your constraint messages are clear.

Regards,
-Clayton

··· On Mon, Nov 26, 2012 at 1:33 PM, Jeffrey Jose wrote:

Hi,

We would like to validate/restrict the user inputs to a particular style.
For example, I have a decimal number and would like to restrict the user
input to a single decimal place. How do we achieve this? Is masking like:
99.9 is available? If yes, how do I use it?

Thanks & Regards,
Jeffrey


  1. 0-9 ↩︎