Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

apex:inputField does not have an attribute called disabled. How can I get an apex:inputField to be disabled?

share|improve this question
up vote 11 down vote accepted

An easy and always work workaround:

<apex:outputPanel rendered="{!onOff}">
    <apex:inputField value="{!someField}"/>
<apex:outputPanel rendered="{!NOT(onOff)}">
    <apex:outputField value="{!someField}"/>

With a {!onOff} variable and reRender behavior, the field behavior can be controlled just as you actually need.

share|improve this answer
I think you mean to use "rendered" instead of "reRender" – DaveS Apr 12 '15 at 0:24

The reason is because this component responds to the read-only state of the field it is bound to (for example if the users profile does not permit editing of the field) via the value attribute.

Note: Read-only fields, and fields for certain Salesforce objects with complex automatic behavior, such as Event.StartDateTime and Event.EndDateTime, don't render as editable when using . Use a different input component such as apex:inputText instead.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.