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
Chandra SekaranChandra Sekaran 

How to show and hide the input field while change the pick list value?

Hi,
I need to show the input text field while changing the pick list value="Yes". Below is my code,
<apex:inputField value="{!comData.Price_decrease_to_preserve_business__c}">
                <apex:actionSupport event="onchange" reRender="reasonForPriceDecrease"/> 
                </apex:inputField>
                
               <apex:outputPanel id="reasonForPriceDecrease">                
                <apex:inputField value="{!comData.Reason_For_Price_Decrease__c}"  rendered="{!comData.Price_decrease_to_preserve_business__c=='Yes'}"/>
                 </apex:outputPanel>
From this code, I can see the input text field.But could not find the text field label.

How to show the input text field with label?

Thanks,
Chandra
 
Mani RenusMani Renus
Put your code inside <apex:pageblocksection> 

Try with below
<apex:pageblocksection> 

<apex:inputField value="{!comData.Price_decrease_to_preserve_business__c}"> <apex:actionSupport event="onchange" reRender="reasonForPriceDecrease"/> </apex:inputField> <apex:outputPanel id="reasonForPriceDecrease"> <apex:inputField value="{!comData.Reason_For_Price_Decrease__c}" rendered="{!comData.Price_decrease_to_preserve_business__c=='Yes'}"/> </apex:outputPanel>

</apex:pageblocksection> 

Hope it helps you.
Chandra SekaranChandra Sekaran
Hi Mani, Thanks for your reply.
Already, my code is inside  <apex:pageblocksection>  only.

Is there any other solutio?
Thanks.