Number fields removes 0 if it's entered at the beginning of the number

Hi, I have a number form that might get a value that start with 0 but it seems that it is being removed. How can I make sure that the number stays as it is, even if the first number is 0?


You will need to use a single line text field if you need to preserve the leading zero(es).

Thanks. Is there a way to limit a single line text field to only accept numbers?

Yes, you can enable the input mask, via a checkbox on the settings for the text field. What sort of values do you expect to be input in this field? Is the value always the same number of characters, but you need to allow the leading zeroes to be preserved? Can you give some examples of the numbers that will be submitted?

It will only be numbers. Its going to be an ID number and I need to keep the 0 if it located at the beginning of the number. It will be a 9 digit number if that matters.

Yes, if it is always 9 digits and you need to keep the leading zero, you can use the single line text field and check the box “Input Mask”, select “Custom” radio button, then enter nine 9’s in the input. Your custom mask will look like this:



When submitting the form, this is how the value is captured:

Thanks Chris :slight_smile:

On a different note, do you have a good tutorial on using math calculations inside Gravity Forms?

We don’t have a good tutorial I don’t think. This is the only documentation I am aware of:

© 2008 - 2019. Gravity Forms is a project by Rocketgenius Inc.