This thread is resolved. Here is a description of the problem and solution.
Problem:
I have the code to limit the number of characters,
works with all fields except the multi-line field. Solution:
Because that is a complex field, not a single simple text line.
You can limit the number of characters in multiline field by using following jQuery code:
$(document).ready(function () {
$('.multiline-field').keypress(function (e) {
maxChars = 10;
if ($('.multiline-field').val().length >= maxChars) {
e.preventDefault();
}
});
}); Relevant Documentation:
This support ticket is created 6 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
in the CRED module (editor JS) I have this code to limit the number of characters,
works with all fields except the multi-line field "racconta". Because ?
Because that is a complex field, not a single simple text line.
I assume the code also does not work on WYSIWYG Fields?
Those fields cannot be validated like this, but we have feature requests in place to allow at least a new filed type or method to count/limit amount of characters.
I have set limit to 10 characters, You can change that number according to your need.
You can add above js code in Js editor and update ‘.multiline-field’ to your multiline field selector.
For further debug, provide temporary access WP-Admin Login and FTP login info to your site. Your next answer will be private which means only you and I have access to it.
=== Please backup your database and website ===
✙ I would additionally need your permission to de-activate and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important.
✙ Please provide backend-end and front-end link where we can see the issue.
Login info is working but issue is in my user role. Can you please update my user role to Administrator so that i can fix the issue.
Please kindly open a new ticket for each issue. This will help other users with similar problems to find solutions when searching the forum. https://toolset.com/toolset-support-policy/