Activity Forums Salesforce® Discussions Is there any method to limit the maximum number of characters that can be typed into input field in Salesforce? Reply To: Is there any method to limit the maximum number of characters that can be typed into input field in Salesforce?

  • Abhinav

    Member
    July 29, 2016 at 1:13 pm

    Hi Pranav,

    Yes, you can call the below function :-

    ({
    limitCharacterTo : function(element, charLimit, evt) {
    var charCode = (evt.which) ? evt.which : event.keyCode;
    if(element.value.length >= charLimit && charCode != 8) {
    return false;
    }
    }
    })