Unyson
Unyson copied to clipboard
Backend Character Limit
Is there any method for limit character of wp-editor from backend?
Waiting for a answer...
No, there is no such kind of method. But why do you need this?
I have developed some custom shortcodes. I need to limit characters of some input text fields. Is there any possibilities to do this?
Every input has an id you hanlde it example for length 5:
$( document ).on( 'change', '#your input id', function () {
var val = $( this ).val();
if ( val.length > 5 ) {
$( this ).val( val.substr( 0, 5 ) );
}
} );
Thank you. I will try this.