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
richa mohantyricha mohanty 

i want to add a pick list field in my visual force pages and add value in it how to do it?

Pls help me new in salesforce
Vatsal KothariVatsal Kothari
Hi Richa,

You can refer below link:
http://www.sfdcpoint.com/salesforce/custom-picklist-in-visualforce-salesforce/

If this solves your problem, kindly mark it as the best answer.

Thanks,
Vatsal
AshlekhAshlekh
Hi,

Here is example with some addational functionality

<apex:page controller="ShowSectionController" tabStyle="Account">
  <apex:form >
  
	<apex:outPutPanel id ="OutPutPanelID">
      <apex:pageBlock id="pg">
          <apex:pageBlockSection title="Select A">
				<apex:selectList value="{!countries}" multiselect="false" size="1">
						<apex:selectOptions value="{!items}"/>
				 <apex:actionSupport event="onchange" action="{!hideSectionOnChange}" rerender="OutPutPanelID"/>	
				</apex:selectList><p/>
		  </apex:pageBlockSection>
		  
          <apex:pageBlockSection title="Section B" rendered="{!(!flag)}">
            
          </apex:pageBlockSection>
       
      </apex:pageBlock>
	  </apex:outPutPanel>
  </apex:form>
</apex:page>
public class ShowSectionController
{
   
    public boolean flag{get;set;}
	public String countries{set;get;}
    public ShowSectionController()
    {
		countries ='';
		flag = true;
       
    }
	
	public List<selectOption> getItems(){
		List<selectOption> x = new List<selectOption>();
		x.add(new SelectOption('','---None---'));
		x.add(new SelectOption('India','India'));
		x.add(new SelectOption('USA','USA'));
		x.add(new SelectOption('England','England'));
	    return x;
	}
    public void hideSectionOnChange()
    {
        if(countries == 'Inida')
            flag = false;
    }
}



Pramod_SFDCPramod_SFDC
Hi,

Check if the below link helps you.

>> http://salesforce.stackexchange.com/questions/26939/mapping-dynamic-picklist-value-from-vf-page-to-custom-field

Regards
Pramod