How to display the help text on Visualforce Page?

when we using the apex:inputField and apex:outputField shows their help Text bubble when nested within a pageBlockSection component automatically like:

<apex:pageBlockSectionItem helptext=”{!$ObjectType.Account.Fields.Phone.InlineHelpText}”>
<apex:outputLabel value=”{!$ObjectType.Account.Fields.Phone.Label}” />
<apex:inputField value=”{!Account.Phone}” />

Syntax to display the Help Text in VF Page:

objectName__c —> SFDC OBJECT API
fieldName__c —> Field API

if we not using the pageBlockSection, then the standard help text bubble is not displayed:

1) If we use “Label” attribute of “apex:outputField” , then helpText bubble is not displayed
2) If we set “showHeader=false”  of <aapex:Page>, in that case also helpText bubbles is not displayed

We can access the help text within an expression by using the respective $ObjectType global variable in visualforce page and here is the example:

<div id=”mainContent”>
Sample helpText bubbles Example
<img src=”/s.gif” alt=”Help” title=”{!$ObjectType.Account.Fields.Phone.InlineHelpText}”/>

By Providing “$ObjectType.Account.Fields.myField__c.inlineHelpText” in <img> tag as TITLE attribute then the helpText will be displayed as ToolTip Text in Image.


Written by 

I am Sakthivel Madesh, a certified Salesforce Advanced Developer & Administrator working on Salesforce Technology since 2011. I am currently working in Techforce Services as Sr. Salesforce Developer. I have worked on multiple technologies Like PHP, Java, Salesforce, I am very passionate about Salesforce and to earn 15x Salesforce Certification. I love Trailhead for learning Salesforce Skill and Become a Trailhead 5x Ranger too. I Love to Learn & Share my Salesforce knowledge to Salesforce Learners/Beginner using My Blog and Salesforce Community.

Leave a Reply

Your email address will not be published. Required fields are marked *