Is it possible to render a section if checkbox is unchecked.
I tried this.
<apex:pageBlockSection columns="1" id="Test" >
<apex:inputcheckbox value="{!test.Same_Address__c}" label="Same as Above" selected="True">
<apex:actionSupport event="onchange" rerender="Test" />
</apex:inputcheckbox>
<apex:outputPanel rendered="{!test.Same_Address__c == false}"> <apex:inputField value="{!test.Contact_Surname__c}" />
<apex:inputField value="{!test.Contact_First_Name__c}" />
<apex:inputField value="{!test.Pos__c}" />
<apex:inputField value="{!test.Addr__c}" />
</apex:outputPanel>
</apex:pageBlockSection>
Class code:-
public with sharing class test{
public Test__c test{get;set;}
public Test(ApexPages.StandardController stdCtrl) {
this.test=(Test__c)stdCtrl.getRecord();
}
}
Query:- I am just not able to see label... but the input field are visible .. i want to hide that as well. This field should be visible only if checkbox is unchecked.
I have added the set of field in output panel and this output panel is rendered only if checkbox is unchecked. But not working as expected.
The checkbox should be by default set to true when page loads. The user can uncheck it if he wishes and see more fields.