![]() Then, add the following code to the form, after the content field (or you can add to the plugin JavaScript settings, or your theme JS file, etc. Here we are using the default content field via shortcode: They do not work with any fields using WP RTE/Visual Editor.įirst, make sure you have a content area or other textarea added to the form. ![]() Note: The techniques below work only with plain-text fields. The following example demonstrates how to add a word counter to the form, and also limit the number of words that may be added. Count and Limit Words with jQuery, Display Word CountĪnother way of limiting the amount of “stuff” that users can add to any textarea is to use a slice of jQuery. You can change the number to whatever works best. To add a max value to any custom field, include maxlength directly in the custom-field definition and give it any non-zero value, for example: data-required#true|maxlength#999 Check out the USP Pro Shortcodes Reference to see which fields support max and min attributes. Here is the USP Forms screen: As shown in the previous screenshot, USP Pro includes various Form Demos to serve as examples and working templates. Likewise for setting a required minimum number of characters, you can add the min attribute to supportive fields. To build and customize USP forms, visit USP Forms and either select an existing form to edit, or click Add New to create a new form. Just change the number to whatever works for you. For example, to add a max value for the post-content area, you can do this: To set a local character limit for any of these fields, add the max attribute and give it any non-zero value. You can override the max-character setting for any of the following fields: You can adjust the max-character values for any of these fields as explained next.ġ Technically, using a value of 0 for the global max-character setting setting means that text will be limited to 999,999 characters. The event can be used on the APEX global page to change the settings of all plug-in instances across all pages in an application. Here is a list of fields that use the global max-character setting as the default value for the maxlength attribute: The plug-in triggers the event (ucfroalabeforeinitialize) in order to extend the Froala configuration with dynamic actions which implement the United Codes Rich Text Editor Pro (Extend) supporting plug-in. The global max-character setting applies to the main post-content textarea, and all primary text inputs. Maximum Character Limit – sets the global maximum character limitįor either of these settings, you can use 0 for no limit 1.Minimum Character Limit – sets the global minimum character limit.To set this global/default value, visit General settings and then specify values for the following options: USP Pro provides a global setting for maximum characters that will serve as the default value for all USP Forms. Complete guide to setting minimum and maximum (min and max) limits on the number of words or characters for the main content field, default text-input fields, or any textarea.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |