+ Start a Discussion
mahidhar Reddymahidhar Reddy 

how to restrict the field in vf pages

Raj VakatiRaj Vakati
You can do by using 
rendered attribute or read-only attribute 

<apex:outputField value="{!x.somefield__c}" rendered={!isVisible}/>


<apex:inputFiled value="{!x.somefield__c}" rendered={!isVisible}/>

Raj VakatiRaj Vakati

with the validation also you can do it 

public class checknumericvalue {
    public string name{set;get;}
    public checknumericvalue(){
    public void check(){
            apexpages.addMessage(new ApexPages.message(apexpages.Severity.WARNING,'give only characters only'));

<apex:page controller="checknumericvalue" >
        <apex:messages />
    <apex:pageBlock title="check value">
        <apex:inputText value="{!name}" />
   <apex:commandButton value="check" action="{!check}" />

mahidhar Reddymahidhar Reddy
tanq raj..