Restrict Number of characters in text box

Use maxLength property to set maximum limit in a textbox. 
Sample code is shown below-





var ele = document.getElementById('txt');
ele.maxLength = 5;



Published by Sandeep Kumar

He is a Salesforce Certified Application Architect having 11+ years of experience in Salesforce.

Leave a Reply