function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
srikanth cheerasrikanth cheera 

Picklist and Button

we will have a dropdown with the names here will be a Email button which will only become enabled once a dropdown value is selected.
srikanth cheerasrikanth cheera
By using Apex and Vf
 
Balu_SFDCBalu_SFDC
If you are using Lightning then simply put onchange="{!c.enblebutn}" action on the Lighnting:select/ui:select and in the Controller.js just enable the button

Lightning comp:
<aura:component>
<ui:inputSelect class="slds-select"  label="piklicst"  value="{!v.objecFiledAPI}" onchange="{!c.enbleSubut}">
                    <aura:iteration items="{!v.PicklstValues}" var="item">
                        <option text="{!item.label}" value="{!item.value}" selected="{!item.selected}" />
                    </aura:iteration>
                </ui:inputSelect>
<lightning:button aura:id="sbutId" label="Submit" variant="brand" class="button" disabled="true"/>
</aura:component>                 


Controller.js
enbleSubut : function(component, event, helper) {
 var myButton = component.find("sbutId");                
 myButton.set('v.disabled', false);           
}         
 
NitishNitish
Using Action function call the apex method and set the boolean variable value as true and then use the Disabled in command button.
I hope it will work.
srikanth cheerasrikanth cheera
plz use only apex and visualforce