Displaying HelpText on VF page

Friday, September 18, 2009 by Aslam - The Alexendra
Hi,
We can easily show a custom field's help text on our page on our desired image like this:-

For example there is a custom field in Account object named 'Active__c'. And you wanna show its help text on VF page, do this:-

<img src="/resource/1247568559000/del_img" alt="" title="{!$ObjectType.Account.Fields.Active__c.inlineHelpText}"/>

If you need pure css based tooptip with your own style and without any javascript, here it is:-

<style>
a:hover {
background:#ffffff;
text-decoration:none;
} /*BG color is a must for IE6*/


a.tooltip span {
display:none;
padding:2px 3px;
margin-left:8px;
width:130px;
}


a.tooltip:hover span{
display:inline;
position:absolute;
background:#ffffff;
border:1px solid #cccccc;
color:#6c6c6c;
}
</style>


<a class="tooltip" href="#">
<img src="/resource/1247568559000/del_img"/>
<span>{!$ObjectType.Account.Fields.Active__c.inlineHelpText}.</span>
</a>


Enjoy!
Posted in | 2 Comments »

2 comments:

Unknown said...

Usefull tip...
thanks

Unknown said...

Useful tip ..
thnx

Post a Comment