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
gprasunagprasuna 

Dropdown values within javascript

Hi,

 

When i am using this code

 

   <apex:facet name="header">Dec-09</apex:facet>
   <apex:inputField id="dec" style="width:80px" value="{!input.Dec__c}"/>
 
 

 

I am getting a dropdown values for Dec-09 from salesforce database,

 

Now i have to create a javascript function and i need to get the values mentioned above within this function. how do i do that.

Can anyone help me.

 

Thanks,

prasuna

Message Edited by gprasuna on 02-05-2009 06:16 AM
aalbertaalbert

I think you are going to need to use the  "describe" functionality of Apex to generate the a list of picklist values for a specific field. Then pass that list to the VF page as a property and have your javascript iterate across the entire list of values.

 

Here is a 2 line example of getting a list of picklist values for the standard Account object, Rating picklistfield:

 

Schema.DescribeFieldResult F = Account.Rating.getDescribe(); List<Schema.PicklistEntry> ratingPicklistValues= F.getPicklistValues();

 

More information here on dynamic apex.

 

 

Unless you just want the value a user selects from the <apex:inputField>, then you can use the actionFunction or actionSupport components of VF to pass that value.