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
LithiumsLithiums 

inputcheckbox value

I was trying to get the value of the inputcheckbox on click, it always return 'on' instead of 0 or 1. How to I get the value of the checkbox so that I can knw if it is checked or unchecked.

 

<apex:repeat value="{!phaseList}" var="p">
                    <apex:inputCheckbox id="chkbox" onclick="createTask('{!$Component.chkbox}')"/>
                    <apex:outputLabel for="chkbox" value="{!p.Name}"/><br/>
                </apex:repeat>

 

 

Best Answer chosen by Admin (Salesforce Developers) 
ForceMantis (Amit Jain)ForceMantis (Amit Jain)

Lithiums

 

Try to use 'checked' attriubute if you are trying to get value in javascript.

All Answers

ForceMantis (Amit Jain)ForceMantis (Amit Jain)

Lithiums

 

Try to use 'checked' attriubute if you are trying to get value in javascript.

This was selected as the best answer
LithiumsLithiums

Nice, it worked.

 

Thanks a lot !!!