You need to sign in to do that
Don't have an account?
uday kumar y
How to hide the Permanent Address in the below code
<apex:page controller="Address">
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >
<apex:inputText value="{!Name}" label="Name"/>
</apex:pageBlockSection>
<apex:pageBlockSection title="Temporary Address">
<apex:inputText value="{!City}" label="City"/>
<apex:inputText value="{!Address}" label="Address"/>
</apex:pageBlockSection>
<apex:pageBlockSection title="Addresscheck">
<apex:inputCheckbox value="{!Addresscheck}" label="Addresscheck"/>
</apex:pageBlockSection>
<apex:pageBlockSection title="Permanent Address">
<apex:inputText value="{!City1}" label="City1"/>
<apex:inputText value="{!Address1}" label="Address1"/>
</apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton value="save" action="{!saverecords}"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
public class Address{
public string Name{set;get;}
public string City{set;get;}
public string Address{set;get;}
public string City1{set;get;}
public string Address1{set;get;}
public boolean Addresscheck{set;get;}
public pageReference saverecords(){
pageReference pref = null;
Address__c ad = new Address__c();
if(Addresscheck == True){
ad.Name = Name;
ad.City__c = City;
ad.Address__c = Address;
ad.City1__c = City;
ad.Address1__c = Address;
}
else{
ad.Name = Name;
ad.City__c = City;
ad.Address__c = Address;
ad.City1__c = City1;
ad.Address1__c = Address1;
}
insert ad;
pref = new pageReference('/'+ad.Id);
return pref;
}
}
Click the inputcheckbox automatically hide the Permanent Address pageblocksection?
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >
<apex:inputText value="{!Name}" label="Name"/>
</apex:pageBlockSection>
<apex:pageBlockSection title="Temporary Address">
<apex:inputText value="{!City}" label="City"/>
<apex:inputText value="{!Address}" label="Address"/>
</apex:pageBlockSection>
<apex:pageBlockSection title="Addresscheck">
<apex:inputCheckbox value="{!Addresscheck}" label="Addresscheck"/>
</apex:pageBlockSection>
<apex:pageBlockSection title="Permanent Address">
<apex:inputText value="{!City1}" label="City1"/>
<apex:inputText value="{!Address1}" label="Address1"/>
</apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton value="save" action="{!saverecords}"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
public class Address{
public string Name{set;get;}
public string City{set;get;}
public string Address{set;get;}
public string City1{set;get;}
public string Address1{set;get;}
public boolean Addresscheck{set;get;}
public pageReference saverecords(){
pageReference pref = null;
Address__c ad = new Address__c();
if(Addresscheck == True){
ad.Name = Name;
ad.City__c = City;
ad.Address__c = Address;
ad.City1__c = City;
ad.Address1__c = Address;
}
else{
ad.Name = Name;
ad.City__c = City;
ad.Address__c = Address;
ad.City1__c = City1;
ad.Address1__c = Address1;
}
insert ad;
pref = new pageReference('/'+ad.Id);
return pref;
}
}
Click the inputcheckbox automatically hide the Permanent Address pageblocksection?
Try Below Code
i use javascript to hide your section.
I think this may help you
Thanks
Hemant
try this.....
Regards,
vijay
kindaly mark as best answer if it help you