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

populate a text box value by selecting value from picklist in lightning component
Suppose there is an inputfield/picklist field.........i want to populate an output textbox with the value of input field or value selected in picklist.
how to do this?
how to do this?
I have specially created a formula that you can directly use to fulfil your requirement of always setting a weekday on any input
Here’s the code snippet:
If you found it useful please appreciate my efforts and mark it as the best answer
Thanks,
Soyab
All Answers
I've gone through your requirement and you can refer below code:
Lightning code:-->
<aura:component>
<aura:attribute name="ShowText" type="String" />
<lightning:select aura:id="selectItem" label="Select an item" onchange="{!c.doSomething}">
<option value="">choose one...</option>
<option value="1">one</option>
<option value="2">two</option>
</lightning:select>
<ui:outputText label="Selected Value:" value="{!ShowText}"/>
</aura:component>
JS Controller-->
({
doSomething :function(c,e,h){
var selectValue=component.find("selecteItem").get("v.value");
component.set("v.ShowText",selectValue);
},
})
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha
www.kdeepali.com
this error is coming
when i run it
I have specially created a formula that you can directly use to fulfil your requirement of always setting a weekday on any input
Here’s the code snippet:
If you found it useful please appreciate my efforts and mark it as the best answer
Thanks,
Soyab
How to get the value of component.set("v.ShowText",selectValue);
and Insert it onhadlesubmit ?