+ Start a Discussion
Deepthi deviDeepthi devi 

Billing State to be pick list and Text

I have a picklist field 'address type' values are us ,canada and foreign.If I select US and Canada the billing state should show list of predefined values and for ,address type' is selected as foreign the billing state should be text field and should be able to enter any value.We are using visual force pages.Please help me on this
Deepak GulianDeepak Gulian
Share your VF code!
Deepthi deviDeepthi devi
These are the two fields I uesd(in address type i have USA,Canada,foreign wich is picklist)
<apex:inputField value="{!Account.address_type__c}" id="addtype"/>
<apex:inputField value="{!Account.ShippingStreet}" id="Street"/>
Deepak GulianDeepak Gulian
<apex:pageBlockSection columns="2"> 
         <apex:actionRegion >
                <apex:inputField value="{!Account.address_type__c}">
                <apex:actionSupport event="onchange" reRender="billFields"/>
                </apex:inputField>
         </apex:actionRegion>
                <apex:outputPanel id="billFields">
                <apex:inputField rendered="{!If(Account.address_type__c != 'foreign',true,false)}" value="{!Account.BillingState}"/>
                <apex:inputText rendered="{!If(Account.address_type__c == 'foreign',true,false)}"  value="{!Account.BillingState}"/>
                </apex:outputPanel>
</apex:pageBlockSection>
Please correct the fields name its just a sample code for your help!