You need to sign in to do that
Don't have an account?
Hari Sankar R 9
custom validation in LWC
Hi,
I JUST WANT SOME SMALL MODIFICATIONs,,,AND ADD SOME VALIDATIONS
Like in Name if i will give null input it will throw the error “INVALID NAME”. Like phone number if i will give null input it will throw the error “INVALID phone"
I JUST WANT SOME SMALL MODIFICATIONs,,,AND ADD SOME VALIDATIONS
Like in Name if i will give null input it will throw the error “INVALID NAME”. Like phone number if i will give null input it will throw the error “INVALID phone"
You will need to use setCustomValidity() and reportValidity() methods to validate and display custom errors.Refer to the below documentation:
https://developer.salesforce.com/docs/component-library/bundle/lightning-input/documentation
Please mark this resolved by using best answer if this solves your issue.
Thank you
All Answers
I JUST WANT SOME SMALL MODIFICATIONs,,,AND ADD SOME VALIDATIONS
Like in Name if i will give null input it will throw the error “INVALID NAME”. Like phone number if i will give null input it will throw the error “INVALID phone" with the alert message I need to populate.
You will need to use setCustomValidity() and reportValidity() methods to validate and display custom errors.Refer to the below documentation:
https://developer.salesforce.com/docs/component-library/bundle/lightning-input/documentation
Please mark this resolved by using best answer if this solves your issue.
Thank you
Record edit page in lightning input field like name & phone number validation ,ADD SOME VALIDATIONS using LWC
Please help me out