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
karthic sankar 9karthic sankar 9 

Enable dependent input field by choosing a value in a picklist.

Hi Guys,

I tried a lot and stuck up in a loop, can any one kindly please help me?

When I select "Y" for Monday_Availability__c, then Pre_Vet_Reviews__c should be enabled. This is the code I have. Kindly help.

   <apex:pageBlock title="Availability">
    <div style="float:left; width: 800px; margin-right: 20px;">
        <apex:pageBlockTable value="{!ListValues}" var="a">
<apex:actionRegion > 
            <apex:inputField value="{!a.Monday_Availability__c}" id="pb1"/>
            <apex:actionSupport event="onchange" rerender="pb1" />
              </apex:actionRegion> 
</apex:pageBlockTable>
        </div>
<apex:pageBlock title="Core Categories">
        <div styleClass="labelCol vfLabelColTextWrap">
           <table border="1px" width="100%" height="80%" style="page-break-inside:auto;">
<apex:repeat value="{!ListValues}" var="a" >
                  <tr>
                       <th>Pre-Vet Reviews</th>
                       <th>180 Mins</th>
                       <td><apex:inputField value="{! a.Pre_Vet_Reviews__c}" rendered="{!a.Monday_Availability__c=='Y'}" required="{!a.Monday_Availability__c=='Y'}"/></td>
 </tr>
  </apex:repeat>
       </table>
             </div>
             </apex:pageBlock> 
Gaurav Sharma 472Gaurav Sharma 472
you have to write it as IF condition.

<td><apex:inputField value="{! a.Pre_Vet_Reviews__c}" rendered="{! If(a.Monday_Availability__c=='Y',true,alse)}" required="{!a.Monday_Availability__c=='Y'}"/></td>


something like that