I have a visual force page where I want to disable the user from editing some of the fields on it. I used the css class attribute to identify these fields.
Input Textboxes were disabled successfully using this approach, but the lookup fields are still accessible.
How can I disable the lookup fields so that the user is unable to make any changes?
Declaration of Field:
<apex:inputField styleClass="makeSelectReadOnly" value="{!Opportunity.AccountId}" required="true"/>
JQuery to disable the field:
jQuery(".makeSelectReadOnly").attr("disabled","true");
jQuery(".lookupIcon").hide();
works, but also hides the icon for the Opportunity Owner which needs to stay. :)jQuery('.makeSelectReadOnly').next().click(function(e){e.preventDefault();})