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;
}
}
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
Here is example with some addational functionality
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