+ Start a Discussion
RadDude89RadDude89 

Field appearing based on criteria

Hi,

Is it possible to show a field on a visualforce page based on previous selection?

For example: if the value in field 1 was true then show field 2 in the vf page else it doesn't appear.

Best Answer chosen by RadDude89
Bhawani SharmaBhawani Sharma
<apex:inputField value="{!Account.Type}" >
    <apex:actionSupport event="onChange" reRender="opField2">
</apex:inputField>

<apex:outputPanel id="opField2">
    <apex:inputField value="{!Account.Name}" rendered="{!(Account.Type = 'Some Value')}" />
</apex:output:Panel>

All Answers

Bhawani SharmaBhawani Sharma
<apex:inputField value="{!Account.Type}" >
    <apex:actionSupport event="onChange" reRender="opField2">
</apex:inputField>

<apex:outputPanel id="opField2">
    <apex:inputField value="{!Account.Name}" rendered="{!(Account.Type = 'Some Value')}" />
</apex:output:Panel>

This was selected as the best answer
Bhawani SharmaBhawani Sharma
Did it help?
RadDude89RadDude89

Hi Bhawani,

Yeah it did, thanks for the reply

Bhawani SharmaBhawani Sharma
Great. Can you please mark the question resolved?