3

I am displaying 2 checkbox and I want to display name of the 2 checkbox as Yes and No, but it is not displaying.

Inputcheckbox

and here is code:

<apex:page sidebar="false" showHeader="false" standardStylesheets="false">
<apex:pageBlock>
2. Have there been any significant changes in employment or income or do?<br></br>
<apex:inputCheckbox label="yes"/>
<apex:inputCheckbox /><br></br>
3. Have there been any significant changes in your savings investment future?<br></br>
<apex:inputCheckbox />
<apex:inputCheckbox /><br></br>
</apex:pageBlock>
</apex:page>
4

The label of checkbox wouldn't display unless it is in an <apex:pageBlockSection>. Otherwise, you will have to state the label manually.

| improve this answer | |
  • I have written inside <apex:pageBlock> but still not displaying. – avidForce Dec 3 '16 at 6:45
  • @avidForce My fault. Should be <apex:pageBlockSection>. I have edited my answer – Lance Shi Dec 3 '16 at 6:50
1

Another possibile solution, that does not require the <apex:pageBlockSection>, is the <apex:outputLabel>:

<apex:form id="myform">
    <apex:inputCheckbox value="{!bMyValue}" id="MyCheckbox"/>
    <apex:outputLabel value="Checkbox label" for="MyCheckbox"/>
</apex:form>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.