You need to sign in to do that
Don't have an account?

How to grey out (disable) an apex:inputField based on the value defined in a checkbox?
Hi,
I have a check box field and an apex: inputfield on a visualforce page. The page should initally load with apex:inputfield as readonly (greyout) and as soon as the user ticks the checkbox the field should be available for entering text. How can I achieve this using Javascript?
Thank You.
I have a check box field and an apex: inputfield on a visualforce page. The page should initally load with apex:inputfield as readonly (greyout) and as soon as the user ticks the checkbox the field should be available for entering text. How can I achieve this using Javascript?
Thank You.
Ex.:
<apex:inputCheckbox value="{!myBoolean}">
<apex:actionSupport event="onclick" reRender="myPanel"/>
</apex:inputCheckbox>
<apex:outputPanel id="myPanel">
<apex:inputText value="{!myString}" disabled="{!myBoolean}"/>
</apex:outputPanel>
Hope this helps!