You are viewing limited content. For full access, please sign in.

Question

Question

Numeric Field Lead zero

asked on June 12, 2017

Is there any way to stop a numeric field in Forms from dropping a lead zero?

0 0

Replies

replied on June 12, 2017 Show version history

Unfortunately no, the only way to have a leading zero is to store the value as a string because something like "01" or "001" is not truly numeric.

Your best best would be to use a standard text input field, then either use regex to mark non-numeric values as invalid, or use JavaScript to restrict user inputs and ignore non-numeric character keystrokes in the field.

However, restricting keystrokes can become very complicated and there's a lot of loopholes, so either way you will need to add the regex validation to the field to make sure it it only contains characters 0-9.

2 0
You are not allowed to follow up in this post.

Sign in to reply to this post.