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
mmaxtrammaxtra 

How you get HelpText in VF next to inputField???

Hi:

   I have an input Field and I wanted a help text next to it just like in regular saleforce. How would I do that???

LIke the little "i" blue icon.

 

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

I wouldn't have thought the simple act of focusing would break it, so maybe its the fact that you have hijacked the onload.  Try something like the following, which adds your function to any existing onload handler:

 

 

<script> function addOnLoad(fn) { var old = window.onload; window.onload = function() { old(); fn(); }; } func = function() {

focus('{!$Component.pageblock.pageblocksection1.intialservicerequest}');

}; addOnLoad(func); function focus(id) { document.getElementById(id).focus(); } </script>

 

 

 

All Answers

mtbclimbermtbclimber

Either embed your inputField within a pageBlockSection or, unrelated to inputField you can access any fields' help through an expression like this:

 

{!$ObjectType.Account.Fields.AccountNumber.inlineHelpText}

 

 

mmaxtrammaxtra
I do have it in the pageBlock Section but I do see the orange icon with the question mark... The only thing is it is shaded out... An user can not click on it?
mmaxtrammaxtra

I do see the issue and since this is a wizard I have a javascript on the first step which focus on the pageblocksection...

 

<script type="text/javascript"> window.onload=function() { focus('{!$Component.pageblock.pageblocksection1.intialservicerequest}'); } function focus(id){ document.getElementById(id).focus(); }</script>

 If I take this out then the icons appear and work... but I need this...

Is there a way around it??? 

 

 

bob_buzzardbob_buzzard

I wouldn't have thought the simple act of focusing would break it, so maybe its the fact that you have hijacked the onload.  Try something like the following, which adds your function to any existing onload handler:

 

 

<script> function addOnLoad(fn) { var old = window.onload; window.onload = function() { old(); fn(); }; } func = function() {

focus('{!$Component.pageblock.pageblocksection1.intialservicerequest}');

}; addOnLoad(func); function focus(id) { document.getElementById(id).focus(); } </script>

 

 

 

This was selected as the best answer