function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shuhbam SinhaShuhbam Sinha 

How to remove "Complete this field" error message from LWC

Hello Everyone,
I am facing one issue related to LWC. I am using record edit form to create case record and I have some Lightning Input Fields on my form. The issue is there are two fields which are dependent on one picklist field. This picklist field has two values 'Physical'and 'Digital'.If user selects physical the other two fields become mandatory and if they select Digital both the fields are not mandat. If user selects Physical then both the fields become mandatory and at the same time without saving the record if user change back the picklist value to Digital both the values become non manadat but the error' complete this field' still persists . The error and the red border do not hide. Do we have any workaround on the same. 

User-added image


User-added image
PrabhaPrabha
These must be required fields at the field definition. Can you check?
If so, remove that 'Required' attribute and add the JS logic according to your explanation there.
Shuhbam SinhaShuhbam Sinha
I already made it non required if you refer the screenshots but the error message is not going away if i onchange event fires.