How can I re-render particular pageblocksection based on the onchange event from dropdownlist?
So here is what I have done:
<apex:pageBlockSection title="Select Record Type" columns="1">
<apex:selectList id="countries" value="{!RecordType}" size="1" required="true">
<apex:selectOptions value="{!RecordTypes}"/>
</apex:selectList>
</apex:pageBlockSection>
<apex:pageBlockSection rendered="{!RecordType.Name == 'employer'}" columns="1">
<apex:outputText>Employer section</apex:outputText>
</apex:pageBlockSection>
<apex:pageBlockSection rendered="{!RecordType.Name == 'employee'}" columns="1">
<apex:outputText> Employee section</apex:outputText>
</apex:pageBlockSection>
My record type names are:
- Employer
- Employee
Best Answer
Try this: