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
keerthana chowdharykeerthana chowdhary 

Display a text field after a checkbox is checked in visualforce

salesforce mesalesforce me
<apex:pageBlock id="theBlock">
   <apex:inputCheckbox value="{!theSObject.CheckBox__c}">
      <apex:actionSupport event="onchange" rerender="theBlock"/>
   </apex:inputCheckbox>

   <apex:inputText value="{!theSObject.TextField__c}" disabled="false" rendered="{!(theSObject.CheckBox__c == true)}"/>
   <apex:inputText value="{!theSObject.TextField__c}" disabled="true" rendered="{!(theSObject.CheckBox__c != true)}"/>

   <!-- Or to simply have a field that appears only when the box is checked -->
   <apex:inputText value="{!theSObject.TextField__c}" rendered="{!(theSObject.CheckBox__c == true)}"/>
</apex:pageBlock>

hi check it once...
Praveen Venkata BPraveen Venkata B
You can achive this using rendered as below:

Change the code accordingly per your requirement.
<apex:page standardController="Object">
    <apex:form >
        <apex:pageBlock id="thePageBlock">
            <apex:actionRegion >
                <apex:pageBlockSection id="pbs1" title="Basic Information" columns="2"> 
                    <apex:inputField value=" {!object.checkboxfieldAPI}">
                        <apex:actionSupport event="onchange" reRender="thePageBlock" status="status"/>
                    </apex:inputField>
                   <apex:actionStatus startText="Loading..." id="status"/>
                </apex:pageBlockSection>
            </apex:actionRegion>
                <apex:pageBlockSection title="Text Box section" id="Section" columns="2"  collapsible="false" rendered="{!Object.checkboxfieldAPI==true}"> 
                    <apex:inputField value="{!object.textFieldAPI}"/>
                </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>


 
keerthana chowdharykeerthana chowdhary
thank u
keerthana chowdharykeerthana chowdhary
how to achieve the same scinerio using picklist ra
Praveen Venkata BPraveen Venkata B
In the above code replace checkboxfieldAPI with PicklistAPIname and true with the picklist value.
keerthana chowdharykeerthana chowdhary
thank u so much raaa...thank thank u