Add maxlength attribute to text inputs