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
Victor19Victor19 

Checkbox display on VF page

Hi,
 
I have created a checkbox field and am displaying it on a visualforce page using inputField.
 
However, the checkbox seems to appear on the right side after the field label. Is there a way to put the checkbox on the left side before the field label?
 
Thanks!
 
Best Answer chosen by Admin (Salesforce Developers) 
Val ValinoVal Valino

Is it in a pageblocksectionitem?

 

Not sure if this will work but try this...

 

<apex:pageBlockSectionItem>
<apex:inputField value="{!field.name}" id="field"/>
<apex:outputLabel value="Field Label" for="field"/>
</apex:pageBlockSectionItem>

All Answers

Val ValinoVal Valino

Is it in a pageblocksectionitem?

 

Not sure if this will work but try this...

 

<apex:pageBlockSectionItem>
<apex:inputField value="{!field.name}" id="field"/>
<apex:outputLabel value="Field Label" for="field"/>
</apex:pageBlockSectionItem>

This was selected as the best answer
Victor19Victor19
Thanks Val! Worked just as expected. I am trying to display the help texts for the fields on the VF page. Would you happen to have any suggestions?

Thanks again!
Val ValinoVal Valino

try this

 

<apex:pageBlockSectionItem helpText="text here">

 

also, please mark my previous answer as the solution.

 

Thanks.