+ Start a Discussion
Jyosi jyosiJyosi jyosi 

based on input field (PickList) in visualforce page to show and hide few fields in visualforce page

Hello Everyone,

I have picklist field country on visualforce page ,whenever user selects the USA on the page , i need to show two fields extra on the page.
Below is the code ,but i am not able to get that 

<apex:pageBlockSection>
<apex:inputField value="{!XXX.Country__c}" />
</apex:pageblocksection>
<apex:pageBlockSection>
<apex:inputField value="{!XXX.XXX}"  />
            <apex:inputField value="{!XX.XXX"/>

<apex:pageBlockSection>

can you please help me out.

Thanks for the Help.


Regards,
Jyo
Pradeep Kumar L.GPradeep Kumar L.G
1. Add your hide/show fields in separate section.
2. Use boolean variable with rendered attribute, by default boolean value is false. So that your hide/show section will not show up.
3. Use onchage attribute on inputfield tag call javascript or actionfunction to change boolean value from false to true, based on your condition.
4. reRender your hide/show section.

Thanks
Pradeep


Mark this answer solved if this resolve your problem.
 
Jyosi jyosiJyosi jyosi
Thanks pradeep

Is it possible to construct the code

Thanks
Jyo