2

I have used record edit form with "lightning:inputfield" and i want to set values of those input fields from JS controller.But when i have tried using following code values are not getting set/updated for which i have manually changed the values from UI(user input) anyone having same problem ?

CODE :

MARKUP :

<lightning:recordEditForm aura:id="editRecordFormForContact" 
objectApiName="Contact">
    <lightning:inputField aura:id='inputFieldToDisaply' fieldName="FirstName"  />

    <lightning:button class="slds-m-vertical_small" variant="brand" label="set value"  title="set value" onclick="{!c.setValues}" />
</lightning:recordEditForm>

Js controller :

setValues: function(component, event, helper) {
   var fields= component.find("inputFieldToDisaply");
   for(var i in fields){
        fields[i].set("v.value",'test');
   }
}

here, 'test' is only getting set if user dont enter name from UI if for once user update first name it wont set test for click of set values.

This issue is still coming.

  • Hey the question you have mentioned here, the answer given there is not at all working – Chintal Somaiya Aug 22 '18 at 11:19