functions – Limit the length of the character in the Message field of the Pirate form in WordPress

In my WordPress website, I use Pirate Forms Plugin to post a contact form on my website. It works well and everything is fine. However, I want to allow my users to be able to insert a limited number of characters in the Subject and Message fields of my contact form.

There is no option in the plugin settings that can help me limit the number of characters when a user submits the form.

Although Pirate Forms Plugin is now owned by WPForms and this plugin does not have any support, but because of the requirements of my site, I can not use another plugin.

I tried to add a CSS class to these specific fields of the form and then applied a custom code to limit their character limit, but the code does not work.

Here is the code I applied for this.

wpf_char_limit_textbox () {function
?>
<? php
}
add_action (& # 39; wpforms_wp_footer & # 39; wpf_char_limit_textbox & # 39;);