[SalesForce] How to show help text image next to inputText

I just need next to either label or inputText

Screen shot:



<apex:page standardController="Account">
    <apex:form >

        <apex:pageBlock >
            <apex:pageBlockSection > 
                      <apex:inputfield value="{!Account.fax}" label="Fax"/>
                       <span class="helpButtonOn" id="Name-_help">  
                        <img src="/s.gif" alt="" class="helpOrb"   />
                        <script type="text/javascript">sfdcPage.setHelp('Name', 'this is a test');</script>


Best Answer

You should just use the <apex:pageBlockSectionItem> tag:

        <apex:pageBlockSectionItem helpText="This is a test">
            <apex:outputLabel value="{!$ObjectType.Account.fields.Fax.label}" />
            <apex:inputField value="{!Account.Fax}" />

Here's the documentation on that attribute:

The help text that is displayed next to this field as a hover-based tooltip, similar to the text that is displayed next to standard Salesforce fields if custom help is defined for the field in Setup. Note that help text only displays if the showHeader attribute of the parent page is set to true.