You need to sign in to do that
Don't have an account?
CrmEditr
make a non required field to be required in salesforce lighting web component
I would like to create lwc wherein I want to make some non- required fields as required whenever user does not enter a value. May be display with message or flag a lable.
Check below references.
https://developer.salesforce.com/docs/component-library/bundle/lightning-input-field/specification
http://ways2salesforce.com/index.php/2020/08/12/validate-fields-on-ui-in-lwc/
Thanks,
add required="true" in your markup for input field.
<aura:component >
<aura:attribute name="EmpName" type="String" default='' />
<lightning:input label="Employee Name" value="{!v.EmpName}" required="true"/>
</aura:component>
If it is work for you please mark as the best answer.if you face any problem let me know.