+ Start a Discussion
ezhil_kezhil_k 

I have createa a Vf page .If i click the "review button" i want to make the input fileds read oly.

<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>

Sonali BhardwajSonali Bhardwaj

You can try below logic. I did it for a field of Account.

 

Page :

<apex:page standardController="Account" extensions="myClass">
    <h1>Application Form</h1>
    <apex:form >
        <apex:pageMessages id="error"/>
        <apex:pageBlock >
        <apex:pageBlockSection title="Information">
       
        <apex:inputText value="{!Account.Name}" disabled="{!readOnly}"/>
        
        </apex:pageBlockSection>
         <apex:commandButton value="Review" action="{!makeReadOnly}"/>

      </apex:pageBlock>
    </apex:form>
    </apex:page>

 class

public class myClass {
    public boolean readOnly {get; set;}
    public myClass(ApexPages.StandardController controller) {
         readOnly = false;
    }


    public void makeReadOnly() {
        readOnly = true;
    }
}

 

ezhil_kezhil_k

Thank you ,its working.Is it possible to pass the same values to another page with read only mode  when review button is clicked,?