Programming

Character limit message to text & textarea fields in ACF

Sometimes, you might one to limit the character of text that user input in the text or textarea field to prevent user input from breaking the design of the website. This feature is included in the ACF plugin, but it doesn’t display any info when the character limit is reached.

Lets follow the following steps to display the message for maxlength in input fields

1. Load your js document in the admin page. I want to load my js file only for Alert Options Page.

2. The following js code displays the character left in the input field when the user input the text in textarea field. Add this js code in your character-limit.js file and save the file.

Now, you can see the character limit message when you add the content in your ACF textarea field.

Hits: 947

Standard