You need to sign in to do that
Don't have an account?

how to allow only alphabet in lightning input text
Hi,
I have used a lightning input text. I want to allow only alphabet and restrict numbers, special characters and space.
Thnx,
Vai
I have used a lightning input text. I want to allow only alphabet and restrict numbers, special characters and space.
Thnx,
Vai
I've gone through your requirement and I came across a simpler way using the APEX controller extension class.
I used the following code in the extension class to check if the value is numeric or not.
Apex Controller>>>
boolean check = pattern.matches('[a-zA-Z]+',stringname);
if (check == true) {
the error message you want to display
}
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha
www.kdeepali.com
Hi Vaibhav,
Please try the Validation rule something like this
NOT(REGEX(
your field name ,"^[a-z A-Z]*$")))
If you find this helpful mark it as the best answer
Hi Vaibhav,
You can try this:
Please mark it as Best Answer If it helps!
Thanks