Number Field Validation Doesn't Work

I am using number fields with format 9,999.99. If I enter letters or other non-numeric characters in any of these fields and submit, the form submits without validation error and no entry is made in the number field in the post.

I have switched themes to disable all CSS and JS and deactivated all other plugins to eliminate conflicts and problem persists.

Any thoughts on how to get the validation to work?

Hi Chris,

I’ve tested the number fields but was unable to replicate the issue you’ve mentioned. Could you please try to reproduce the issue on a fresh installation and then send me a screenshot?

CleanShot 2024-12-27 at 11.57.17

Thank you

Thanks for the reply. Here are screenshots to demonstrate this issue.

Here is a screenshot of a form setup.

Here is the page with the form. Entering a number in the field works fine as demonstrated.


Form submitted.

Entry from Gravity Forms dashboard. All of this works great. Text and number field populated properly.

Entering non-numeric entry in number field.

Submitting this form - there is no validation error for non-numeric.

From Gravity forms docs. This states that the field validates to make sure that a number was entered.

Entry from Gravity Forms dashboard. This is the form entry with the text field populated and the number field empty.

How is this supposed to work so that the user entry is validated to be a number?

Thank you!

Hi Chris,

Sorry for the delay. Could you please export the form and upload it to Google Drive, iCloud, Dropbox, or https://wetransfer.com/ and send me the link? This will allow me to download and test it in my sandbox to find the root cause of the issue. Thank you.

The number field value is only validated when the range settings are configured. The value is sanitized on entry save, which is why the non-numeric characters aren’t saved. You can use the gform_field_validation filter to perform custom validation of the value:

1 Like