0

I have an issue with my dependent pick list. my controlling picklist should not be editable but salesforce requires that it should be in the visual force page as an input field together with my dependent picklist. I got a java script solution from one of the forums but it's not working. I hope that someone can help me figure out what's wrong with it. Thank you!

Here is my code: Java script

 <script type="text/javascript">
        var $j = jQuery.noConflict();
        $j(document).ready(function() {
             $('[class*=" disabledPicklist"]').each(function() {
                  $j(this).prop('disabled', 'disabled');
             }
        };
    </script>  

visual force page

<apex:sectionHeader />
  <apex:form enctype="multi-part/form-data">
    <apex:pageMessages ></apex:pageMessages>
    <apex:pageBlock title="Assign Recruitment Team">
      <apex:pageBlockSection title="Account Group and Account">
        <apex:inputField value="{!RRF__c.RRF_ACCT_GRP_CD__c}"
           styleClass="disabledPicklist"/>                      
        <apex:inputField value="{!RRF__c.RRF_ACCT_CD__c}" styleClass="disabledPicklist"/>
      </apex:pageBlockSection>
      <apex:pageBlockSection title="Recruitment Officer and Team Lead">
        <apex:inputField value="{!RRF__c.RRF_ASS_RO__c}"/>
        <apex:inputField value="{!RRF__c.RRF_ASS_TM_LD__c}"/>
      </apex:pageBlockSection>
      <apex:pageBlockSection title="Recruiters">
        <apex:pageBlockSectionItem >
          <apex:inputField value="{!RRF__c.RRF_ASS_REC__c}" />  
        </apex:pageBlockSectionItem>       
      </apex:pageBlockSection>
      <apex:pageBlockButtons style="float:right;">
         <apex:commandButton value="Save" action="{!Save}"/>
      </apex:pageBlockButtons>
   </apex:pageBlock>
 </apex:form>
  • Welcome @User4712 and thanks for your first question, you don't forget to familiarise yourself with formatting the question body so that things like code are clearly outlined. – Bartley Dec 5 '13 at 16:02
  • 1
    In the third line of your JS function, you aren't using your no conflict variable. Change $ to $j – Chris Duncombe Dec 5 '13 at 17:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.