+ 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 !!!