Title: maxlenght
Last modified: November 24, 2016

---

# maxlenght

 *  Resolved [alitscha](https://wordpress.org/support/users/alitscha/)
 * (@alitscha)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/maxlenght-2/)
 * how do you recommend to limit the number of characters (in textarea and text 
   input) with your plugin? thanks!

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/maxlenght-2/page/2/?output_format=md) 
[→](https://wordpress.org/support/topic/maxlenght-2/page/2/?output_format=md)

 *  [mrpetreli](https://wordpress.org/support/users/mrpetreli/)
 * (@mrpetreli)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/maxlenght-2/#post-8483815)
 * Use the input mask tick box
 * Then use regex
    [9 | a | *] : optional {int | * | +} : length Any length character
   only: [a{*}] Any length number only: [9{*}] email: *{+}@*{2,}.*{2,}[.[a{2,}][.[
   a{2,}]]]
 * [https://regex101.com/](https://regex101.com/)
 *  Plugin Contributor [christiechirinos](https://wordpress.org/support/users/christiechirinos/)
 * (@christiechirinos)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/maxlenght-2/#post-8483967)
 * Hi alitscha,
 * Thanks for using Caldera Forms. This looks like a specific support request, and
   I’m super glad to see mrpetreli helped you out. Just so you know for the future,
   we do not offer support for Caldera Forms via this board. You might get help 
   from users like mrpetreli, but the channel to get support from us directly is
   to open a support ticket at [https://CalderaWP.com/support](https://CalderaWP.com/support).
   Through that form, someone from our team will follow up about this issue within
   1 business day.
 * Please note that to use our support form, you must have an active license for
   any Caldera Forms add-on ([https://calderawp.com/caldera-forms-add-ons/](https://calderawp.com/caldera-forms-add-ons/))
   or a support license ([https://calderawp.com/support/#priority-support](https://calderawp.com/support/#priority-support)).
   Sorry about the hassle, and thanks for understanding that this is separate channel
   allows us to ensure that we are able to continue to develop great products for
   you.
 *  Thread Starter [alitscha](https://wordpress.org/support/users/alitscha/)
 * (@alitscha)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/maxlenght-2/#post-8485836)
 * [@mrpetreli](https://wordpress.org/support/users/mrpetreli/): thanks for the 
   advice! But where should I enter the regex? I don’t see any input mask tickbox
   for textarea fields…thanks!
 * [@christiechirinos](https://wordpress.org/support/users/christiechirinos/): thanx
   for the feedback, I’ll consider that but I am using the plugin in behalf of clients
   so they have to decide about buying the license first.
 *  [mrpetreli](https://wordpress.org/support/users/mrpetreli/)
 * (@mrpetreli)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/maxlenght-2/#post-8486399)
 * [@alitscha](https://wordpress.org/support/users/alitscha/) see here⌊Mask⌉
 *  Thread Starter [alitscha](https://wordpress.org/support/users/alitscha/)
 * (@alitscha)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/maxlenght-2/#post-8492814)
 * [@mrpetreli](https://wordpress.org/support/users/mrpetreli/) – thanks! yet the
   option is not there for textarea. maybe I’ll do a feature request about it. And
   about lenght
    {int | * | +} where should I place the max number of characters?
   I don’t seem to find it in the documentation…thx again!
 *  [mrpetreli](https://wordpress.org/support/users/mrpetreli/)
 * (@mrpetreli)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/maxlenght-2/#post-8493069)
 * [@alitscha](https://wordpress.org/support/users/alitscha/) Use single line text
   area, the paragraph text does not have it.
 * You won’t find the regex specifics in the documentation. Instead look at [https://regex101.com/](https://regex101.com/)
   for examples and testing
 * [http://realsocialseo.com/regex-testing/](http://realsocialseo.com/regex-testing/)
    -  This reply was modified 9 years, 5 months ago by [mrpetreli](https://wordpress.org/support/users/mrpetreli/).
 *  Thread Starter [alitscha](https://wordpress.org/support/users/alitscha/)
 * (@alitscha)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/maxlenght-2/#post-8555369)
 * thanks mrpetreli, anyway my clients need a textarea
 *  [fredhimself](https://wordpress.org/support/users/fredhimself/)
 * (@fredhimself)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/maxlenght-2/#post-8690878)
 * hi, it looks like this mask field does not support complexe regex like :
    ^(0?[
   1-9]|[12][0-9]|3[01])[\/](0?[1-9]|1[012])[\/]\d{4}$ to validate a date (dd/mm/
   yyyy) field for example.
 *  [mclarets](https://wordpress.org/support/users/mclarets/)
 * (@mclarets)
 * [9 years ago](https://wordpress.org/support/topic/maxlenght-2/#post-9046847)
 * Has anyone found an actual way of limiting the number of characters in Caldera?
   The mask doesn’t use regex despite what [@mrpetreli](https://wordpress.org/support/users/mrpetreli/)
   claims. For example, I can’t seem to require someone to enter “this sentence.”
   in Caldera field and limit it to 10 alpha-numeric characters including spaces.
   Seems like pretty basic functionality for a forms plugin and shouldn’t require
   premium add-ons or custom PHP functions when Caldera provides so much other great
   functionality in the basic plugin.
 * Update: I saw an older post in this forum that references [https://calderaforms.com/doc/caldera_forms_field_attributes/](https://calderaforms.com/doc/caldera_forms_field_attributes/)
   but I’m hoping there is an easier method that provides the user with some feedback
   on the max. characters allowed and doesn’t require custom PHP gists.
    -  This reply was modified 9 years ago by [mclarets](https://wordpress.org/support/users/mclarets/).
    -  This reply was modified 9 years ago by [mclarets](https://wordpress.org/support/users/mclarets/).
 *  [mrpetreli](https://wordpress.org/support/users/mrpetreli/)
 * (@mrpetreli)
 * [9 years ago](https://wordpress.org/support/topic/maxlenght-2/#post-9050364)
 * [@mclarets](https://wordpress.org/support/users/mclarets/) its an exact phrase
   you are trying to capture?
 * So for Mountians the regex would be like /^Mountain$/
 * Have you tried to test the expression here: [https://regex101.com/](https://regex101.com/)
 *  [mclarets](https://wordpress.org/support/users/mclarets/)
 * (@mclarets)
 * [9 years ago](https://wordpress.org/support/topic/maxlenght-2/#post-9063020)
 * [@mrpetreli](https://wordpress.org/support/users/mrpetreli/) No! The OP asks 
   how to “limit the number of characters”. You can easily do this in regex, but
   who cares because Caldera doesn’t currently allow you to use Regex in the input
   mask. As you can see in your own screen shot, that’s not regex even though it
   uses braces { }.
 * An example of limiting the number of characters would be to only allow a user
   to enter 20 characters in a text field. You can only do this with Caldera’s limited
   input masks if you don’t allow users to enter spaces or punctuation intheirsentence.
   Please actually have a working solution before you suggest more things like regex.
    -  This reply was modified 9 years ago by [mclarets](https://wordpress.org/support/users/mclarets/).
 *  [mrpetreli](https://wordpress.org/support/users/mrpetreli/)
 * (@mrpetreli)
 * [9 years ago](https://wordpress.org/support/topic/maxlenght-2/#post-9064707)
 * [@mclarets](https://wordpress.org/support/users/mclarets/) I have regex working
   on a form, but since you are too ignorant of solutions you would figure it out.
   Guess you will have to pay for support via CFF
    -  This reply was modified 9 years ago by [mrpetreli](https://wordpress.org/support/users/mrpetreli/).
      Reason: support
 *  [IanFox](https://wordpress.org/support/users/ianfox/)
 * (@ianfox)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/maxlenght-2/#post-9427612)
 * [@mrpetreli](https://wordpress.org/support/users/mrpetreli/) WTF? [@mclarets](https://wordpress.org/support/users/mclarets/)
   is right. I can’t figure this one out too.
 * How on earth is this something to pay support over? It’s a basic HTML attribute!
   
   Question remains : how do you limit the amount of characters users can type in
   a textfield?!
 *  [IanFox](https://wordpress.org/support/users/ianfox/)
 * (@ianfox)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/maxlenght-2/#post-9427830)
 * I’ve “fixed” it wit javascript…
 *     ```
       	$("[class*='maxlength-']").each(function() {
       		 var num = $(this).attr('class').match(/\d+$/)[0];
   
       		 if(!isNaN(num)) {
       			 $(this).find("input, textarea").attr('maxlength',num);
       		 }
       	});
       ```
   
 * and then add the class maxlength-<number> to the textfield… Not ideal, but hey:
   I want to get things working.
 *  [fredhimself](https://wordpress.org/support/users/fredhimself/)
 * (@fredhimself)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/maxlenght-2/#post-9443285)
 * i gave up with Caldera few mounth ago and switch to “Webdorado form maker pro”
   cause for few $/€ “form maker pro” is far far better and user friendly than Caldera
   form i spend many night reading Calderas support pages and found inconsistency
   in the knowledge base i.e how to tweak calendar into dd/mm/yyyy format, searching
   in the plugin’s code for bootstrap or jquery calendar. No need to talk about 
   translation.
    Pay for support when basical functionalty are provided ok but that’s
   not the Caldera case. Have a look to Webdorado form just to make your own opinion.
   Your calderas code do not contain comments, sorry but i have to say that’s tipical
   bad dev habit ! One day i tryed to buy caldera form and i had needed to send 
   you a mail just to find the link to the page where i can pay for it ! Your commercial
   positioning is a bit confusing sry mrpetreli. Regards

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/maxlenght-2/page/2/?output_format=md) 
[→](https://wordpress.org/support/topic/maxlenght-2/page/2/?output_format=md)

The topic ‘maxlenght’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/caldera-forms_475846.svg)
 * [Caldera Forms - More Than Contact Forms](https://wordpress.org/plugins/caldera-forms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/caldera-forms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/caldera-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/caldera-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/caldera-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/caldera-forms/reviews/)

## Tags

 * [character](https://wordpress.org/support/topic-tag/character/)
 * [length](https://wordpress.org/support/topic-tag/length/)
 * [limit](https://wordpress.org/support/topic-tag/limit/)
 * [maxlength](https://wordpress.org/support/topic-tag/maxlength/)

 * 17 replies
 * 7 participants
 * Last reply from: [twistedkaos](https://wordpress.org/support/users/twistedkaos/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/maxlenght-2/page/2/#post-9524786)
 * Status: resolved