• Resolved alitscha

    (@alitscha)


    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)
  • mrpetreli

    (@mrpetreli)

    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/

    Plugin Contributor christiechirinos

    (@christiechirinos)

    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. 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/) or a support license (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

    (@alitscha)

    @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: 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.

    @alitscha see hereMask

    Thread Starter alitscha

    (@alitscha)

    @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!

    @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/ for examples and testing

    https://realsocialseo.com/regex-testing/

    • This reply was modified 7 years, 12 months ago by mrpetreli.
    Thread Starter alitscha

    (@alitscha)

    thanks mrpetreli, anyway my clients need a textarea

    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.

    Has anyone found an actual way of limiting the number of characters in Caldera? The mask doesn’t use regex despite what @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/ 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 7 years, 7 months ago by mclarets.
    • This reply was modified 7 years, 7 months ago by mclarets.

    @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/

    @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 7 years, 7 months ago by mclarets.

    @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 7 years, 7 months ago by mrpetreli. Reason: support

    @mrpetreli WTF? @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?!

    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.

    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)
  • The topic ‘maxlenght’ is closed to new replies.