# How to get values of node configuration checkboxes

**URL:** <https://discourse.nodered.org/t/how-to-get-values-of-node-configuration-checkboxes/62202>\
**Category:** Developing Nodes\
**Created:** [4 May 2022 22:46 UTC](https://discourse.nodered.org/t/how-to-get-values-of-node-configuration-checkboxes/62202 "2022-05-04T22:46:15Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [5 May 2022 08:32 UTC](https://discourse.nodered.org/t/how-to-get-values-of-node-configuration-checkboxes/62202/4 "2022-05-05T08:32:54Z")

</div>

To echo the answer by @Steve-Mcl - the below should cater for it.

The definition and necessary callbacks.

```auto
RED.nodes.registerType('my-module', {
    defaults: {
        bits: {
            value: []
        }
    },
    oneditsave: Save,
    oneditprepare: Restore

});

function Save() {
    const NumCheckBoxes = 3;
    this.bits = [];
    for (let i = 0; i < NumCheckBoxes; i++) {
        this.bits.push($(`#CheckBoxIndex_${i}`).is(":checked"));
    }
}

function Restore() {
    for (let i = 0; i < this.bits.length; i++) {
        $(`#CheckBoxIndex_${i}`).prop('checked', this.bits[i]);
    }
}

```

And the HTML. No need for the `node-input-` ID prefix, as they are not directly associated with a config definition.

```auto
<div class="form-row">
    <label for="CheckBoxIndex_0" style="width:130px"><i class="fa fa-pencil"></i> CheckBox 1</label>
    <input type="checkbox" id="CheckBoxIndex_0">
</div>

<div class="form-row">
    <label for="CheckBoxIndex_1" style="width:130px"><i class="fa fa-pencil"></i> CheckBox 2</label>
    <input type="checkbox" id="CheckBoxIndex_1">
</div>

<div class="form-row">
    <label for="CheckBoxIndex_2" style="width:130px"><i class="fa fa-pencil"></i> CheckBox 3</label>
    <input type="checkbox" id="CheckBoxIndex_2">
</div>

```

Then, in your module  
`config.bits[0]` will yield `true` | `false` for checkbox 1

---

_[View the full topic](https://discourse.nodered.org/t/how-to-get-values-of-node-configuration-checkboxes/62202)._
