Setting a minimum or maximum range for numbers field can be helpful in a lot of cases. Like, have a job application form where the age limit is one of the criteria. So, adding that limit on the form itself will reduce the number of submissions from uneligible candidates having age more or less than the required criteria.
WPForms doesn’t have any range limiting setting in its numbers fields. There are two ways by which you can enable min/max limit on number fields as follows
- Using free Booster for WPForms plugin
- Adding Custom code to functions.php
Steps to add Range Limit using Booster for WPForms
- Install and activate Booster for WPForms from the official WordPress plugin repository. It is a free plugin and you can also directly install it from your WordPress dashboard by searching for it under ‘Plugins -> Add New’.
- Now go to WPForms -> Settings -> Booster and check the ‘Min, Max range for Numbers’ setting.

Enable Min/max Settings

set min, max range
- Open you form editor and click on any number’s field. Under ‘Advanced tab’ you will now have the option to enter the minimum and maximum number for that field.
- Now whenever someone will enter a number that is outside of the range then an error message will be shown with instructions about the range limit.
- With Booster for WPForms, you can add a whole lot of other features to your form. You can mark fields as read only or change validation messages for the form etc.
How to add Range Limit to Number Fields using Javascript code
- This process requires you to add some javascript code in your functions.php file as well as setting up a class for each field for which you want to limit the range.
- Copy and paste the below code in your functions.php file.
- Once you have added the code then add bfwpf-number-range-limit under Advanced Options -> CSS Classes of number field in which you want to apply the limit.
- You can change the limit for min and max values in the code above as per your requirement.
- Let us know in the comments section below about which method you used and if you had any issues with it.



0 Comments