i cant figure out, how to restrict length of <lightning:inputField>. Something like in HTML <input type="text" name="usrname" maxlength="10">.

Is it possible to do with some attribute or there must by some sort of code, in that case, what code? :)

Thanks for any help.


You can use onChange event to check lenght of the value of this inputfield and if it is bigger than max lenght change value of the Input field to one beforelast action and show some validation message

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.