function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
Hi,
you can use java scrip in onload of a page and set the attribute 'readOnly' to true for inputField.
Let give me an example:
<apex:page standardController="Account" id="thePage"> <apex:form id="theForm"> <apex:pageBlock id="theBlock"> <apex:pageBlockSection id="theSec"> <apex:inputField value="{!Account.name}" id="accName" /> </apex:pageBlockSection> </apex:pageBlock> <script> function setResult(){ document.getElementById('thePage:theForm:theBlock:theSec:accName').readOnly=true; } window.onload = setResult; </script> </apex:form></apex:page>
Please let me know if u have any problem on same and if this post helps u give KUDOS by click on star at left.
Thanks for your reply ! is there any option that can be made in vf tag as read only?
Here is my code.Once I click Review butoon ,i want to make the input feilds to read only..
<apex:page standardController="Application__c" extensions="app"> <h1>Application Form</h1> <apex:form > <apex:pageMessages id="error"/> <apex:pageBlock > <apex:pageBlockSection title="Information"> <apex:inputText value="{!Application__c.Name}"/> <apex:inputText value="{!Application__c.Candidate_Name__c}"/> <apex:inputText value="{!Application__c.Age__c}"/> <apex:inputText value="{!Application__c.Address__c}"/> <apex:inputText value="{!Application__c.Contact_Number__c}"/> </apex:pageBlockSection> <apex:commandButton value="Review" />
</apex:pageBlock> </apex:form>
</apex:page>
When we create the field,in FLS(Field level Security), check the field as read only. And since you are using <apex:inputField>, the field will reflect as 'READ-ONLY'.
-Kaity
You can also use <apex:outputfield> tag, to make a field read-only.
-Kaity.
Hi,
you can use java scrip in onload of a page and set the attribute 'readOnly' to true for inputField.
Let give me an example:
<apex:page standardController="Account" id="thePage">
<apex:form id="theForm">
<apex:pageBlock id="theBlock">
<apex:pageBlockSection id="theSec">
<apex:inputField value="{!Account.name}" id="accName" />
</apex:pageBlockSection>
</apex:pageBlock>
<script>
function setResult(){
document.getElementById('thePage:theForm:theBlock:theSec:accName').readOnly=true;
}
window.onload = setResult;
</script>
</apex:form>
</apex:page>
Please let me know if u have any problem on same and if this post helps u give KUDOS by click on star at left.
Thanks for your reply ! is there any option that can be made in vf tag as read only?
Here is my code.Once I click Review butoon ,i want to make the input feilds to read only..
<apex:page standardController="Application__c" extensions="app">
<h1>Application Form</h1>
<apex:form >
<apex:pageMessages id="error"/>
<apex:pageBlock >
<apex:pageBlockSection title="Information">
<apex:inputText value="{!Application__c.Name}"/>
<apex:inputText value="{!Application__c.Candidate_Name__c}"/>
<apex:inputText value="{!Application__c.Age__c}"/>
<apex:inputText value="{!Application__c.Address__c}"/>
<apex:inputText value="{!Application__c.Contact_Number__c}"/>
</apex:pageBlockSection>
<apex:commandButton value="Review" />
</apex:pageBlock>
</apex:form>
</apex:page>
When we create the field,in FLS(Field level Security), check the field as read only. And since you are using <apex:inputField>, the field will reflect as 'READ-ONLY'.
-Kaity
Hi,
You can also use <apex:outputfield> tag, to make a field read-only.
-Kaity.
use the folowing
<apex:inputText value="{!Account.Name}" html-readonly="true" />