What is the best approach to force the input of one decimal point precision on a decimal value using the numpad keyboard?

Hi,

I want to make sure that the user inputs at least exactly one decimal point on a value. Ex: 120.0 or 123.2. This is done to provide incentive not to round numbers (it's for a weight / height measurement).

I've managed to achieved this by using a text fields with a regex validation. The issue is that the regular keyboard shows up, so users have to click on the 123 modifier key and input the value using the row of numbers. It works but not super convenient.

Is there there another way to achieve the same validation while using the numpad instead, i.e. force the type of keyboard independently of the type of field? It doesn't matter if the value that in saved is 120 if the entry is 120.0, as long as the validation verifies that there is a decimal value.

Thanks!

#it4life

Hello Guillaume,

I believe you should be able to do that by setting an appearance attribute of "numeric" on a text question. The regular expression you mention can validate the existence of a decimal place, and the appearance attribute should default the phone to the number pad entry instead of a full keyboard. You can see documentation on how to set appearance attributes on the help site.

Cal

Hi Cal,

It works! Thanks a lot. I have to read this page once and for all. It's the second time I get pointed to it :slight_smile:

Cheers,