Skip to main content
Hello ,

I have a lightning input for which I need to enforce below pattern. How can I achieve this? XXX.XX-XX    X can be both letter or number. Thank you so much! 
2 respostas
  1. 4 de out. de 2023, 08:14
    Hi Alexandra,

    You can use the pattern attribute along with a regular expression  to validate the input format.

    You can try something like below:

    <lightning:input label="Your Input" pattern="[A-Za-z0-9]{3}\.[A-Za-z0-9]{2}-[A-Za-z0-9]{2}" />

    If this information helps, please mark the answer as best. Thank you

     
0/9000