function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Soujanya Uppal 9Soujanya Uppal 9 

i want to show pageblock when i write pancard in text box of Enter document then pancard pageblock shows after click on apply button

Hi!!
i want to show pageblock when i write pancard then pancard pageblock shows after click on apply button  if i write passsport then passport block shows on click of apply button

Here is the code i have used---------

<apex:page standardController="Account" >
    <apex:form>
        <apex:pageBlock title="Applying Documents">
            <apex:pageBlockSection title="Documents to Apply">
                <apex:inputtext label="Enter Document"/>
            </apex:pageBlockSection>
            <apex:commandButton value="Apply"/>
            
            <apex:pageBlock title="Pancard">
                <apex:pageBlockSection title="Personal Details">
                    <apex:inputfield value="{!Account.Name}"/>
                    <apex:inputfield value="{!Account.Phone}"/>
                    <apex:inputfield value="{!Account.Website}"/>
                </apex:pageBlockSection>
                <apex:pageBlockSection title="Birth Details">
                    <apex:inputField label="Date of Birth" value="{!Account.SLAExpirationDate__c}"/>
                    <apex:inputtext label="Place of Birth"/>
                </apex:pageBlockSection>
                <apex:pageBlockSection title="Education Details">
                    <apex:inputtext label="Enter X Board"/>
                    <apex:inputtext label="Enter XII Board"/>
                </apex:pageBlockSection>
            </apex:pageBlock>
            
            <apex:pageBlock title="Aadhar Card">
                <apex:pageBlockSection title="Personal Details">
                    <apex:inputtext label="Mother Name"/>
                    <apex:inputtext label="Father Name"/>
                    <apex:inputtext label="Name"/>
                </apex:pageBlockSection>
                <apex:pageBlockSection title="Address Information">
                    <apex:inputtext label="City"/>
                    <apex:inputtext label="State"/>
                    <apex:inputtext label="Street"/>
                    <apex:inputtext label="Pincode"/>
                </apex:pageBlockSection>
            </apex:pageBlock>
            
            <apex:pageBlock title="Passport">
                <apex:pageBlockSection title="Personal Details">
                    <apex:inputtext label="Name"/>
                    <apex:inputtext label="Mother Name"/>
                    <apex:inputtext label="Father Name"/>
                    <apex:inputtext label="Email"/>
                </apex:pageBlockSection>
                <apex:pageBlockSection title="Address Information">
                    <apex:inputtext label="City"/>
                    <apex:inputtext label="State"/>
                    <apex:inputtext label="Street"/>
                    <apex:inputtext label="Pincode"/>
                </apex:pageBlockSection>
                <apex:pageBlockSection title="Education Details">
                     <apex:inputtext label="Enter X Board"/>
                    <apex:inputtext label="Enter XII Board"/>
                </apex:pageBlockSection>
            </apex:pageBlock>
            
            
        </apex:pageBlock>
    </apex:form>
</apex:page>User-added image
PriyaPriya (Salesforce Developers) 
Hi Soujanya,

In Visualforce we have rendered attribute which we can use for displaying the pageblock conditionaly. 

See the below examples that will help you to fix yours :- 

https://help.salesforce.com/s/articleView?id=000324662&type=1

https://developer.salesforce.com/forums/?id=9060G0000005Z8BQAU

https://salesforce.stackexchange.com/questions/204934/conditionally-show-apexpageblockbuttons

Please mark it as best answer if it answer your question so that it will help others as well.

Regards,
Priya Ranjan