You need to sign in to do that
Don't have an account?
Hari Sankar R 9
With an onchange event handler on a lightning-input-field (text field) in LWC
Hi ,
Please help me in scenario for lightning-input-field (text field) in LWC .
Field like phone number,Text field ( name ) should throw custom validation error when field is null (require lightning input fields).
Please help me in scenario for lightning-input-field (text field) in LWC .
Field like phone number,Text field ( name ) should throw custom validation error when field is null (require lightning input fields).
Example code that you can customize as per your requirement:
In JS file, define the handlePhoneChange and handleNameChange functions to perform custom validation:
Related:https://www.sfdcstop.com/2021/08/custom-validation-in-lightning-web.html?m=1
https://salesforce.stackexchange.com/questions/343804/how-to-show-a-custom-validation-message-on-a-field-in-lightning-record-edit-form
https://techdicer.com/custom-validation-in-lightning-web-component/
Thanks