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
Abhinav AdminAbhinav Admin 

HI, I am creating a visualforce page there i have some picklists and fielddependencies on those, now my requirement is when i select Others in picklist i need to populate a text area.

Hi

I am creating a visualforce page there i have some picklists and fielddependencies in those, now my requirement is whenever i select a "Others" in a picklist i need to populate a Textfield. Can any one please suggest me the answer along with the code.


Thanks&Regards,
Abhinav.
KaranrajKaranraj
Hi Abhinav - You can able to do that using actionsupport and rendered functionality in visualforce page.
Check the below code for the example
<apex:pageBlock id="pb1">
<apex:pageBlockSection>         
<apex:actionRegion >               
  <apex:inputField id="f1" value="{!Object.picklistfieldapiname1}" required="true" >
     <apex:actionSupport event="onchange" rerender="pb1" />
  </apex:inputField>
</apex:actionRegion>
</apex:pageBlockSection>
<!-- This section will be displayed only if the picklist field value is set to Other -->
<apex:pageBlockSection id="pbs1" rendered="true">
 <apex:inputField id="f2" value="{!Object.Fieldtobedisplayed1}" rendered="{!IF(Object.picklistfieldapiname1 ='Other' ,true,false)}"/>
</apex:pageBlockSection>
<!-- End of re-render section -->
</apex:PageBlock>
Thanks,
Karanraj