You need to sign in to do that
Don't have an account?
Herish Surendran
I tried this but it didn't work
How to write regex for first name and last name in js of lightning component
var firstnameRegex = "[a-zA-Z]"; var firstname = component.get("v.First_Name"); var FirstnameMatch = firstname.match(firstnameRegex); if(FirstnameMatch == false){ alert("Please fill in the mandatory details"); }
I tried this but it didn't work
Hi,
Please add this pattern in your lightning input.
pattern="^[a-zA-Z][a-zA-Z0-9 ]+$".
If this solves your problem. Mark this as the best answer and solved.
Thanks.
Deepak