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개
  1. 2019년 11월 5일 오전 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