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
Niraj Kr SinghNiraj Kr Singh 

How to disable <apex:inputfield> using javascript

Hi Everyone,
I am facing problem to hide the input field using javascript:
<apex:inputField Id="IFWhatId" value="{!objTask.WhatId}"/>

how can hide this <apex:inputField> using javascript.

Thanks
Niraj
 
Amit Chaudhary 8Amit Chaudhary 8
You can try like below code. I hope that will help you
<apex:outputPanel rendered="{!onOff}">
    <apex:inputField value="{!someField}"/>
</apex:outputPanel>
<apex:outputPanel rendered="{!NOT(onOff)}">
    <apex:outputField value="{!someField}"/>
</apex:outputPanel>
Or Please check below post. I hope that will help you
http://www.tehnrd.com/how-to-disable-visualforce-inputfields/

Please let me know if this will help you

Thanks,
Amit Chaudhary