Please find the code
<apex:page standardController="Case" extensions="demoCaseController" sidebar="false" showHeader="false" cache="true" id="page">
<apex:form id="theForm">
<apex:pageMessages />
<apex:pageBlock title="Partner Support Form" mode="edit" id="pb">
<apex:pageBlockSection columns="1" title="Additional Details" id="otherDetails">
<apex:pageBlockSectionItem id="interfaceSection">
<apex:outputLabel value="{!$ObjectType.case.fields.Interface__c.Label}"/>
<apex:actionRegion >
<apex:inputField value="{!case.Interface__c}" style="width: 126px;" id="interface" required="true">
<apex:actionSupport event="onchange" reRender="detailedFields" action="{!displayAdditionalDetails}" />
</apex:inputField>
</apex:actionRegion>
</apex:pageBlockSectionItem>
<apex:outputPanel id="detailedFields" >
<apex:pageBlockSection id="detailedFields1" columns="1" >
<apex:outputText value="test" />
</apex:pageBlockSection>
</apex:outputPanel>
</apex:pageBlockSection>
<apex:pageBlockButtons location="bottom">
<apex:commandButton onclick="isValidCaptcha(); return false;" value="submit" id="validateButton"/>
</apex:pageBlockButtons>
<apex:actionFunction name="createCaseAction" action="{!createCase}"/>
</apex:pageBlock>
</apex:form>
</apex:page>
Controller
public class demoCaseController {
public case cs;
public demoCaseController(Apexpages.Standardcontroller stdController) {
this.cs = (Case)stdController.getRecord();
}
public pagereference createCase() {
return null;
}
public pagereference displayAdditionalDetails() {
system.debug('test :: '+ cs.Interface__c);
return null;
}
}
I have to output panel blank when user select 'None' value from dropdown. In my code whenever I select 'None' value, function wrote on onchange is not get fired (my requirement is picklist filed is required on page).
reuired='true'
fromapex:inputField
and validatecase.Interface__c
field in controller side. check if it is blank then Add a apexPageMessage and display error like field is required.