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
DineshGuptaDineshGupta 

How to change field label in Visual force (Standard controller)

Hi,

I am writing a VF page using Standard Controller.
To retrieve the fields, I am using <apex:inputField> tag

User-added image

It is showing same name as I have given while creating the field in object, but I want to show a different label on VF page.
I didn't find any attribute of <apex:inputField> tag which helps in changing the field label.

Is there any way to do it ?
 
Best Answer chosen by DineshGupta
Amit Chaudhary 8Amit Chaudhary 8
Please check below post. I hope that will help you
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_inputField.htm
try to use label also
<apex:inputField value="{!account.name}" label ="DEMO"/>

Please let us know if this will help you

Thanks
Amit Chaudhary
 

All Answers

Amit Chaudhary 8Amit Chaudhary 8
Please check below post. I hope that will help you
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_inputField.htm
try to use label also
<apex:inputField value="{!account.name}" label ="DEMO"/>

Please let us know if this will help you

Thanks
Amit Chaudhary
 
This was selected as the best answer
shiva pendemshiva pendem
HI Dinesh,

Use the below line to achieve Label change .

<apex:inputField Value="{!Object__c.field__c}" label="Label name" />

Hope this will be helpful.

Thanks,
Shiva
DineshGuptaDineshGupta
@Amit, @Shiva
Yeah.. it worked.. Thank u..