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
monalisa das 46monalisa das 46 

I have a requirement where I have a validate button for Lightning:recordEditForm on click of which it needs to update certain fields. So my code is something like this

I have a requirement where I have a validate button for Lightning:recordEditForm on click of which it needs to update certain fields. So my code is something like this
<lightning:recordEditForm  aura:id="recordEditForm" 
                                    recordId="{!v.myObject.Id}"
                                    onsuccess="{!c.handleSuccess}" 
                                    objectApiName="Address__c">
        <lightning:inputField fieldName="Address_Line_1_Native__c" aura:id="addrNative" onchange="{!c.fieldValChange}" />     
<lightning:button variant="brand" name="Validate" label="Validate" onclick="{!c.validate}" />                       
    </lightning:recordEditForm>
and within validate() in JS
component.find("addrNative").set("v.value", "Accounting");

This works fine as long user is not entering anything in the field,but when user updates the field and clicks on validate, the button doesn't works
any suggestions?