• Resolved samrot

    (@samrot)


    Hey I’m trying to implement a character count using jQuery to display the user how many characters are left to reach the minimum required for a textarea (that is using tinymce). How can I accomplish this?

    I managed to count it using the code ”?tinymce.activeEditor.getContent({format: ‘text’}).length;” but can’t seem to find a way of triggering this using tinymce’s keyup function. Can you help?

    Best

Viewing 1 replies (of 1 total)
  • Plugin Support Saiful Islam

    (@saifislam01)

    Hi @samrot,

    Thank you for reaching out. I understand that you’re looking to implement a character count for a textarea using the WP User Registration Plugin with TinyMCE. You want to display the number of characters left to reach the minimum required using jQuery and the keyup event in TinyMCE. Here’s how you can achieve this:

    1. You need to initialize TinyMCE and bind the keyup event to it. This event will trigger every time a key is pressed, allowing you to update the character count in real-time.
    2. Use the tinymce.activeEditor.getContent({format: 'text'}).length method to get the current character count.
    3. Update the character count display in your HTML.

    Hope this will help. If you encounter any issues or have further questions, feel free to ask!

    Best regards,

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.