You need to sign in to do that
Don't have an account?
Leticia Monteiro Freitas 4
Turn a field required lightning component
Hello,
I have a lightning component with two fields and I need turn one OR other required.
EX: i need put value in field A or field b. Can anyone help me?
I have a lightning component with two fields and I need turn one OR other required.
EX: i need put value in field A or field b. Can anyone help me?
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/js_validate_fields.htm
All Answers
Greetings to you!
You can use required="true" if you want to make any field required in the Lightning component.
Below is the sample code which I have tested in my org and it is working fine.
Also, please refer to below link for more information on Validating fields:
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/js_validate_fields.htm
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/js_validate_fields.htm