You need to sign in to do that
Don't have an account?

How to set Inputtext field value to null on click of the button+lightning component
Hi,
I have the input text field where i want to clear the text value entered by user on click of the button.
Please suggest me how to achive this.It is really need ASAP.
I have the input text field where i want to clear the text value entered by user on click of the button.
Please suggest me how to achive this.It is really need ASAP.
setNotSoldvalues : function(component, event, helper) {
var action = component.get("c.SaveNotSoldvalues");
var compvalue = component.find("comp").get("v.value");
var compvalue1 = component.find("comp");
action.setParams({
accId : component.get("v.AccountId"),
notsoldvalue1 : compvalue
});
action.setCallback(this, function(response) {
var state = response.getState();
if (state === "SUCCESS")
{
this.wrapperMultiValue(component);
//var emptyval=[];
component.set("v.notsoldvalue",null);
}
});
$A.enqueueAction(action);
}
Thanks
let me inform if it helps you
All Answers
can you share your component code and controller Please
Thanks
var action = component.get("c.SaveNotSoldvalues");
var compvalue = component.find("comp").get("v.value");
var compvalue1 = component.find("comp");
action.setParams({
accId : component.get("v.AccountId"),
notsoldvalue1 : compvalue
});
action.setCallback(this, function(response) {
var state = response.getState();
if (state === "SUCCESS")
{
this.wrapperMultiValue(component);
//var emptyval=[];
}
});
//var compvalue1 = component.find("comp");
//alert(enter);
//compvalue1.set('v.body', null);
$A.enqueueAction(action);
}
componenet
<div>
<fieldSet class="form-group col-md-2">
<div>
<legend class="slds-form-element__label"><b>Add Not Sold Products</b></legend>
<ui:inputText aura:id="comp" class="form-control" value="{!v.notsoldvalue}"/>
//this value in need to make null on click of the Add button
</div>
</fieldSet>
</div>
<div>
<div class="slds-modal__footer slds-modal__footer--directional">
<ui:button class="slds-button slds-button--neutral" label="Cancel" press="{!c.CancelNotSoldSection}"></ui:button>
<ui:button class="slds-button slds-button--neutral" label="Add" press="{!c.setNotSoldvalues}"></ui:button>
</div>
</div>
setNotSoldvalues : function(component, event, helper) {
var action = component.get("c.SaveNotSoldvalues");
var compvalue = component.find("comp").get("v.value");
var compvalue1 = component.find("comp");
action.setParams({
accId : component.get("v.AccountId"),
notsoldvalue1 : compvalue
});
action.setCallback(this, function(response) {
var state = response.getState();
if (state === "SUCCESS")
{
this.wrapperMultiValue(component);
//var emptyval=[];
component.set("v.notsoldvalue",null);
}
});
$A.enqueueAction(action);
}
Thanks
let me inform if it helps you
Thanks a lot..You have saved my time a lot.