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
MMuneeeMMuneee 

i need save button in below code.can you update both vf and custom logic for below code


i need to select both picklist and save them 

Visual force page
==============


<apex:page controller="ctlDepPickLst" tabStyle="Account">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockButtons >
             </apex:pageBlockButtons>
            <apex:pageBlockSection columns="2">
                <apex:pageblockSectionItem >
                    <apex:outputLabel value="Country"/>
                </apex:pageblockSectionItem>        
                <apex:pageblockSectionItem >                
                    <apex:selectList size="1" value="{!country}">
                        <apex:selectOptions value="{!countries}"/>
                        <apex:actionSupport event="onchange" reRender="a"/>
                    </apex:selectList>                
                </apex:pageblockSectionItem>
                <apex:pageblockSectionItem >
                    <apex:outputLabel value="State"/>
                </apex:pageblockSectionItem>            
                <apex:pageblockSectionItem >
                    <apex:selectList size="1" value="{!state}" id="a">
                        <apex:selectOptions value="{!states}"/>
                    </apex:selectList>
                </apex:pageblockSectionItem>            
            </apex:pageBlockSection>        
        </apex:pageBlock>
        <apex:pageBlock >                            
        </apex:pageBlock>
    </apex:form>
</apex:page>



Custom Controller
------------------------===






public class ctlDepPickLst {
    public String country {get;set;}
    public String state {get;set;}
    public PageReference Save()
    {
        return null;
    }
    

    public List<SelectOption> getCountries()
    {
        List<SelectOption> options = new List<SelectOption>();
        options.add(new SelectOption('None','--- Select ---'));        
        options.add(new SelectOption('US','United States'));
        options.add(new SelectOption('IN','India'));
        return options;
    } 
    
    public List<SelectOption> getStates()
    {
        List<SelectOption> options = new List<SelectOption>();
        if(country == 'US')
        {       
            options.add(new SelectOption('CO','Colorado'));
            options.add(new SelectOption('NE','Nevada'));
            options.add(new SelectOption('TE','Texas'));
        }
        else if(country == 'IN')
        {       
            options.add(new SelectOption('AP','Andrapradesh'));
            options.add(new SelectOption('TS','Telangana'));
            options.add(new SelectOption('TM','Tamilnadu'));
        }
        else
        {
            options.add(new SelectOption('None','--- Select ---'));
        }      
        return options;
    }       
}
Sforce.NinjaSforce.Ninja
Hi,
Since you have already included 
  
<apex:pageBlockButtons >
   </apex:pageBlockButtons>

Why don't you simply include attribute location="bottom" like this
 
<apex:pageBlockButtons location="bottom">
   </apex:pageBlockButtons>
and include your save button inside this tag.
 
Sforce.NinjaSforce.Ninja
P.s. if it solves your problem, please mark it as best answered. 
Shashikant SharmaShashikant Sharma
See this  : http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_commandButton.htm

And use apex:commandButton , let me know if you have issues.