Skip to main content
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?
4 réponses
  1. 5 nov. 2019, 10:52
    Hi Agnibha,

    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:

    Component:

    <aura:component implements="flexipage:availableForAllPageTypes" access="global" >

    <aura:attribute name="ShowText" type="String" />

    <lightning:select aura:id="selectItem" label="Select an item" onchange="{!c.changeSelect}">

    <option value="">choose one...</option>

    <option value="Apex Controller">Apex Controller</option>

    <option value="Visualforce Page">Visualforce Page</option>

    <option value="LWC">LWC</option>

    <option value="Aura">Aura</option>

    </lightning:select>

    <hr/>

    <center>

    <ui:outputText value="{!v.ShowText}"/>

    </center>

    </aura:component>

    JS:

    ({

    changeSelect :function(component){

    var selectValue=component.find("selectItem").get("v.value");

    component.set("v.ShowText",selectValue);

    },

    })

    If you found it useful please appreciate my efforts and mark it as the best answer

    Thanks,

    Soyab