You need to sign in to do that
Don't have an account?
Vivek Nayak
Pattern attribute not working in lightning:input
Hi ,
I am using lightning:input of type text and want no special chars to be entered. Some posts say that we can use built-in pattern attribute but its not working for me.No idea what is missing .
<lightning:input aura:id="BiCity"
label="Residential City" value="" required="true" messageWhenPatternMismatch="No special characters allowed"
pattern="[a-zA-Z]"
/>
Any help would be appreciated.
Thanks
I am using lightning:input of type text and want no special chars to be entered. Some posts say that we can use built-in pattern attribute but its not working for me.No idea what is missing .
<lightning:input aura:id="BiCity"
label="Residential City" value="" required="true" messageWhenPatternMismatch="No special characters allowed"
pattern="[a-zA-Z]"
/>
Any help would be appreciated.
Thanks
I guess you problem is you found the value with special chars is still saved.
If that is the case, you may need to add checkValidity() method in js controller before saving.