+ Start a Discussion
Alex Waddell 12Alex Waddell 12 

Hiding a Field Label

Hello, 

I'm looking to hide the label titled "Note" infront of my Text box as circled below.
User-added image
Here is my code for what i have so far. 

<apex:page standardController="Notes_for_the_Day__c">
<style>.pbSubsection{
width: 400px;}</style>
<apex:form >
  <apex:Pageblock Title="Notes on the Day">
  <apex:pageBlockSection columns="1">
  <apex:inputField Value="{!Notes_for_the_Day__c.Note__c}"
 style="height:100px;width:400px;"/>
  <apex:commandButton action="{!save}" value="save"/>

  </apex:pageBlockSection>

  </apex:Pageblock>
Best Answer chosen by Alex Waddell 12
sfdcMonkey.comsfdcMonkey.com
hi Alex
try below code
<apex:page standardController="Notes_for_the_Day__c">
<style>.pbSubsection{
width: 400px;}</style>
<apex:form >
  <apex:Pageblock Title="Notes on the Day">
  <apex:pageBlockSection columns="1">
  <apex:pageBlockSectionItem >
  <apex:outputLabel></apex:outputLabel>  
  <apex:inputField Value="{!Notes_for_the_Day__c.Note__c}"
 style="height:100px;width:400px;"/>
   </apex:pageBlockSectionItem>   
  <apex:commandButton action="{!save}" value="save"/>

  </apex:pageBlockSection>

  </apex:Pageblock>
thanks
let me inform if it helps you and mark it best answer if it helps you so it make proper solution for others :)



 

All Answers

sfdcMonkey.comsfdcMonkey.com
hi Alex
try below code
<apex:page standardController="Notes_for_the_Day__c">
<style>.pbSubsection{
width: 400px;}</style>
<apex:form >
  <apex:Pageblock Title="Notes on the Day">
  <apex:pageBlockSection columns="1">
  <apex:pageBlockSectionItem >
  <apex:outputLabel></apex:outputLabel>  
  <apex:inputField Value="{!Notes_for_the_Day__c.Note__c}"
 style="height:100px;width:400px;"/>
   </apex:pageBlockSectionItem>   
  <apex:commandButton action="{!save}" value="save"/>

  </apex:pageBlockSection>

  </apex:Pageblock>
thanks
let me inform if it helps you and mark it best answer if it helps you so it make proper solution for others :)



 
This was selected as the best answer
Alex Waddell 12Alex Waddell 12

It worked Perfectly! Thank you.

is the trick found in the <Apex:outputlabel> section? why did that work?

sfdcMonkey.comsfdcMonkey.com
trick is on <apex:pageBlockSectionItem > in the apex:pageBlockSectionItem we can use apex:outputLabel for optionally display field label value . :)