You need to sign in to do that
Don't have an account?
Hide or unhide inputfield based on picklist value
When I create a new user, I have option to select type of user (it can be either x or y-Picklist). And now if I select type x, inputfield called "something" will show (by default it is hidden). And if I select type y, this inputfield will hide. I hoped it would work like this, but it does not.
I have the following code:
<apex:form >
<apex:pageBlock title="Create new user" tabstyle="User__c">
<apex:pageBlockSection columns="1">
<apex:inputField label="Name" value="{!User__c.name__c}"/>
<apex:inputField label="Type of user" value="{!User__c.type__c}">
<apex:actionSupport event="onchange" rerender="something"/>
</apex:inputField>
<apex:pageBlockSection id="something" rendered="{!IF(User__c.type__c='x',true,false)}">
<apex:inputField label="Something: " value="{!User__c.something__c}"/>
</apex:pageBlockSection>
</apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
Can anybody help me?
Hi.
Try This. actionFunction.
Regards,