+ Start a Discussion
Kalaivani KKalaivani K 

I need to display text box based on the value selected from dropdwon in oppurtunity object

I  need to display a text box on opportunity object based on the value selected from custom dropdown button in lighting view.
Please let know if any one having ligthing component code for this.
Ajay K DubediAjay K Dubedi
Hi Kalaivani,
Try this code:
Component : (ShowHide.cmp)
<aura:component>
    <aura:attribute name="temp" type="Boolean" default="true" /> 
    <aura:attribute name="options" type="List" default="[
                                                        {'label': 'New', 'value': 'new'},
                                                        {'label': 'In Progress', 'value': 'inProgress'},
                                                        {'label': 'Finished', 'value': 'finished'},
                                                        ]"/>
    <aura:if isTrue ="{!v.temp}">
        <lightning:combobox name="progress" label="Status" value="inProgress" placeholder="Select Progress" options="{! v.options }" onchange="{! c.handleChange }"/>
        <aura:set attribute="else">
            <lightning:input name="input1" label="Enter some text" />
    </aura:set>
    </aura:if>
</aura:component>

Controller : (ShowHideController.js)

({
    handleChange : function(component, event, helper) {
        component.set("v.temp", false);
    }
})

Application : (ShowHideApp.app)

<aura:application extends="force:slds" access="global">
    <c:ShowHide/>
</aura:application>

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi
Kalaivani KKalaivani K
Hi Ajay,

Thank you so much for your reply. I need code with inline edit to show the text box when th value selected from drop down . If you any code please let me know.


User-added image


Thanks,
kalaivani.k