Friday, July 8, 2016

How to Show Place Holder For Input Fields in Visual Force Page

Source Code


<apex:page standardController="Account">
    <apex:form >
    <apex:sectionHeader title="Place Holder in Salesforce"/>
      <apex:pageBlock title="Account Information">
       <apex:pageBlockSection >
           <apex:inputField value="{!account.name}" html-placeholder="I Love Coding...You?"/>
           <apex:inputField value="{!account.AccountNumber}" html-placeholder="478788788"/>
           <apex:inputField value="{!account.Site}" html-placeholder="srinivas4sfdc.com"/>
           <apex:inputField value="{!account.Fax}" html-placeholder="A77GHSH"/>
       </apex:pageBlockSection>         
      </apex:pageBlock>
    </apex:form>
  </apex:page>

Output




Thanks for visiting...Enjoy!

1 comment:

Ramakrishna Madha said...

How to change placeholder value. I need dynamic values in placeholder like below example.
I have picklist with values solid and liquid grams as values and text field.
Type of quantuity: if i choose solid the text field should display killo grams as placeholder and when i choose liquid then text field placeholder should be leters.
Please help me on this