You can already set up your forms to have a maximum number of characters for your Single Line Text field by following the steps in this tutorial.
1) Setting up the form
First, set up your form to add a Single Line Text field and set the maximum number to match your needs. In our example, we’ve set our Limit Length to ten characters.
2) Adding the JavaSript
Next, you’ll need to copy the code snippet below and add it to your site.
In our example below, we’re requiring a minimum of five characters.
3) Adding the CSS Class
Finally, open the form builder, click the field to open its Field Options panel and open the Advanced Options section.
wpf-char-min to the CSS Classes field.
And that’s it! You’ve now set a minimum number of characters for the text field as well as a maximum number.
Would you like to set a minimum and maximum number for checkboxes too? Take a look at our tutorial on How to Set a Minimum and a Maximum Number of Choices for a Checkbox.
Q: Can I use this on Paragraph form fields as well?
Action reference: wpforms_wp_footer_end