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
SF OperatorSF Operator 

Unable to get value of SelectList

I can't get the value of my SelectedList, I can show the values but I can't get the picked one.

SelectOptions is working well.

<apex:actionSupport event="onchange" rerender="OptionReason"/>
        <apex:selectList id="OptionReason" value="{!selectedReason}" multiselect="false" size="1">
            <apex:selectOptions value="{!reasonOptions}"/>
        </apex:selectList>

RituSharmaRituSharma
selectedReason will hold the selected value. I hope you have declared the variable as below in your apex controller.

public string selectedReason{get;set;}
SF OperatorSF Operator
Thanks for your reply, I already have that variable declared and it holds a null value.
RituSharmaRituSharma
Share your apex code as well where you are trying to access the value of selectedReason.