We are replacing ui names space tags with lightning name space tag in the lightning component since they are going to deprecating soon.

We are displaying multiple languages with checkbox’s . When users selects check box language value should update in backend. While using ui:inputCheckbox tag we are able to update the language but if we use lightning:input type="checkbox" language values updating as Boolean value (True) in the back end instead of check box values. Below is the peace of code.

<aura:attribute name="selectAllLanguages" type="Boolean" default="false" />
  <aura:attribute name="languages" type="Object[]" />
 <aura:iteration items="{!v.languages}" var="lang">
  <lightning:input type="checkbox"  value="{!lang.isSelected}" aura:id="boxPackLanguages" />
   <!--<ui:inputCheckbox text="{!lang.language}" value="{!lang.isSelected}" aura:id="boxPackLanguages" />--> 


JS Code:

var languagesSelected = false;
var getAllLanguages = component.find("boxPackLanguages"); 
   if(getAllLanguages != null){
            //if there's only one language
            if (getAllLanguages[0] == null) {
                languagesSelected = true;
            for (var i = 0; i < getAllLanguages.length; i++) {
                if (getAllLanguages[i].get("v.value") == true) {
                    languagesSelected = true;

2 Answers 2


Lightning Checkboxes use the attribute checked, which is consistent with the HTML specification, rather than the ui:inputCheckbox, which called it value. You'll need to set the checked attribute to set the value, and read this value to determine if the box is checked.


You might consider using lightning:checkboxGroup instead. You can see the documentation at https://developer.salesforce.com/docs/component-library/bundle/lightning:checkboxGroup/example along with controller example to get values.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .