I am using a picklist in visualforce page, through apex:inputField in a form. I am saving that value in custom object. And that value is being saved in object. But when I will open that record in the same form (visualforce page). When the form is being loaded that saved value was there. but when the form has been loaded, the value become null and --None-- was selected.
I tried to use javascript with alert, but it was showing that right value. I couldn't find out the issue.
I have used below code:
<apex:pageBlockSectionItem id="Menopausal_StatusItem">
<apex:outputText value="Menopausal Status:" />
<apex:outputPanel >
<apex:inputField value="{!msd.AgeVal__c}" id="ageValId" label="" style="display:none;"/>
<apex:inputField value="{!msd.Menopausal_Status__c}" id="Menopausal_Status" required="true"/>
</apex:outputPanel>
</apex:pageBlockSectionItem>
<!--<script>
alert('{!msd.Menopausal_Status__c}');
alert(document.getElementById('pageId:formId:pageBlockId:pageBlockSectionId:Menopausal_StatusItem:Menopausal_Status').value);
</script>
-->
This is a dependent picklist (msd.Menopausal_Status_c) and the controlling pick list is msd.AgeVal_c.
Please help me. Thanks in advance.