+ Start a Discussion
Malik ButlerMalik Butler 

how do I get an accurate checkbox?

I'm trying to create checkboxes for a few different things. It isn't a field, just a label but I'm not sure what to do because nothing seems to work. 
<tr width = "100%">
    <td width = "5%"><label>
        <input type="checkbox" value="Customer Damage"/>
        <span>Customer Damage</span>
      </label></td>
    <td width = "5%"><label>
        <input type="checkbox" value="Water Related"/>
        <span>Water Related</span>
      </label></td>
    <td width = "5%"><label>
        <input type="checkbox" value="Environmental"/>
        <span>Environmental</span>
      </label></td>
    <td width = "5%"><label>
        <input type="checkbox" value="Non IPS Equiptment"/>
        <span>Non IPS Equiptment</span>
      </label></td>
    <td width = "5%"><label>
        <input type="checkbox" value="User Error"/>
        <span>User Error</span>
      </label></td>
    <td width = "5%"><label>
        <input type="checkbox" value="Power Surge"/>
        <span>Power Surge</span>
      </label></td>
    <td width = "5%"><label>
        <input type="checkbox" value="New Equiptment Install"/>
        <span>New Equiptment Install</span>
      </label></td>
    <td width = "5%"><label>
        <input type="checkbox" value="Other"/>
        <span>Other</span>
      </label></td>
Raj VakatiRaj Vakati
Use checkbox group that enables selection of single or multiple options.  

https://developer.salesforce.com/docs/component-library/bundle/lightning:checkboxGroup/specification

​​​​​​​
<aura:component>
    <aura:attribute name="options" type="List" default="[
    {'label': 'Ross', 'value': 'option1'},
    {'label': 'Rachel', 'value': 'option2'}
    ]"/>
    <aura:attribute name="value" type="List" default="option1"/>

    <lightning:checkboxGroup name="Checkbox Group"
                             label="Checkbox Group"
                             options="{! v.options }"
                             value="{! v.value }"
                             onchange="{! c.handleChange }"/>
</aura:component>

 
Raj VakatiRaj Vakati
Use lightning:input

https://developer.salesforce.com/docs/component-library/bundle/lightning:input/example#lightningcomponentdemo:exampleInputCheckboxButton

 
<aura:component>
    <lightning:input type="checkbox-button" label="Input One" name="input1"/>
    <lightning:input type="checkbox-button" label="Input Two" name="input2" checked="true" required="true"/>
    <lightning:input type="checkbox-button" label="Input Three" name="input3" checked="true" disabled="true"/>
</aura:component>

 
Malik ButlerMalik Butler
Will this work for something that will be used in classic? I'm the only one in my org that uses lightning, everyone else refuses.
Raj VakatiRaj Vakati
Lightning Component will work in classic by using Lighting Out .. If you want to use them in classic use HTML or VF tags 

 
Malik ButlerMalik Butler
I've tried this out after creating the component and it's saying that the conponenet is unknown. This is what my coed looks like.
<td style="font:12px" width = "5%"><lightning:checkboxGroup name="Options"
                             label="Customer Damage"
                             options="{! v.option1 }"
                             value="{! v.option1 }"
                             onchange="{! c.handleChange }"/></td>