Skip Navigation

[Resolved] Limit/count characters in text area for post type form

This support ticket is created 5 years, 4 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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 5 replies, has 2 voices.

Last updated by Lykke Scavenius 5 years, 4 months ago.

Assisted by: Minesh.

Author
Posts
#1287277
excerpt-form.PNG
excerpt.PNG
edit-excerpt.PNG

I have a front end view of psycologists and I am limiting the number of characters by using excerpt. But, they need to be able to work within this limit when editing their short description.

I have a form for them to edit their information and description and I want to limit characters in this textarea directly, a character count would also be valuable in this situation.

I hope you can help point me in the right direction

Thanks,
Lykke

#1287461

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

There is no native solution but you can achieve it by adding some custom JS code to your Form's JS box:

You can try the following solution:
=> https://toolset.com/forums/topic/can-i-limit-characters-count-for-my-single-line-text-field-in-cred-forms/#post-908303
OR
=> https://toolset.com/forums/topic/min-and-max-characterswords/#post-543397
=> https://toolset.com/forums/topic/limit-characters-in-multiple-custom-fields-in-a-cred-form/#post-349223

#1288539

Hi again Minesh 🙂

I tried inserting this code in forms JS section, it doesn't work.
I don't know what field name to put there, since it's the standard excerpt field.

I tried:

excerpt
wp-except
wpcf-excerpt

jQuery(document).ready(function ($) {
  $('[name^=wp-excerpt]').attr('maxlength',200);
});

I also tried without the brackets

jQuery(document).ready(function ($) {
  $('name^=wp-excerpt').attr('maxlength',200);
});

Thanks,
Lykke

#1288563

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please share problem URL where I can see the form and access details?

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1289503

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now. I've adjusted the code as given under to form's Js box:

jQuery(document).ready(function ($) {
 		$('textarea[name="post_excerpt"]').attr('maxlength',152);

});

I can see its working fine now.

#1292051

My issue is resolved now. Thank you!