Tell us what you are trying to do?
I have a number field that should be entered exactly 11 digits no less no more. They must also be numbers only (no symbols).
Is there any documentation that you are following?
https://toolset.com/forums/topic/limiting-field-length-to-display/
but not exactly
Is there a similar example that we can see?
What is the link to your site?
it's a local site
Hi there,
It is considered a custom development and most probably you need to use some sort of Javascript code to achieve that.
https://toolset.com/course-lesson/adding-custom-javascript-to-views-templates-and-archives/
You can check this sample to get started:
https://stackoverflow.com/questions/13491589/javascript-regex-to-match-only-up-to-11-digits-one-comma-and-2-digits-after-it
Also, you will need to do a check later in PHP using the Validate Hook in Toolset forms so if for some reason JS fails on the browser of the customer, backend would not allow the problematic entry:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate
Thanks.
I'm not going to implement this.
THank you anyway
Finally I added the following js to that form:
jQuery(document).ready(function ($) {
$('[name^=wpcf-cuit]').attr('minlength',11);
$('[name^=wpcf-cuit]').attr('maxlength',11);
});