# Compare checkbox checked value

**URL:** <https://discourse.nodered.org/t/compare-checkbox-checked-value/5671>\
**Category:** General\
**Created:** [11 December 2018 10:38 UTC](https://discourse.nodered.org/t/compare-checkbox-checked-value/5671 "2018-12-11T10:38:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hathemi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hathemi/32/3792_2.png) [@hathemi](https://discourse.nodered.org/u/hathemi)\
**Post date:** [11 December 2018 10:38 UTC](https://discourse.nodered.org/t/compare-checkbox-checked-value/5671/1 "2018-12-11T10:38:30Z")

</div>

i'am sending msg.payload from dashboard template node to a mustache template node. what i want to do is to check if the input came from the first template is checked or not, in my second template. i have tried a lot of code but none of them works for me.  
what do i missing here, and thank you.

> ```
> > <td>
> > <input type="checkbox" [checked]="{{payload.0.data8}} == 'true'">
> > </td
> 
> ```

---

<div class="post-metadata">

**Author:** ![hathemi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hathemi/32/3792_2.png) [@hathemi](https://discourse.nodered.org/u/hathemi)\
**Post date:** [11 December 2018 11:57 UTC](https://discourse.nodered.org/t/compare-checkbox-checked-value/5671/2 "2018-12-11T11:57:15Z")

</div>

i solve it. in template dashboard node

> ```
> <td>
> <input type="checkbox" ng-model="msg.payload.data8" name="checkbox1" value="value1" class="toggle-column" ng-true-value="'checked'" ng-false-value="'unchecked'">
> </td>
> 
> ```

in template mustache node

> ```
> > <td>
> > <input type="checkbox" {{payload.0.data8}}>
> > </td>
> 
> ```

---

<div class="post-metadata">

**Author:** ![Marooned](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marooned/32/2858_2.png) [@Marooned](https://discourse.nodered.org/u/Marooned)\
**Post date:** [11 December 2018 12:01 UTC](https://discourse.nodered.org/t/compare-checkbox-checked-value/5671/3 "2018-12-11T12:01:39Z")

</div>

> [@hathemi](#):
>
> payload.0.data8

Well, from what I know, JS does not allow property names to begin with a number, so that `.0` does not look correct to me.

---

<div class="post-metadata">

**Author:** ![hathemi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hathemi/32/3792_2.png) [@hathemi](https://discourse.nodered.org/u/hathemi)\
**Post date:** [11 December 2018 12:55 UTC](https://discourse.nodered.org/t/compare-checkbox-checked-value/5671/4 "2018-12-11T12:55:25Z")

</div>

my msg.payload is an array of object

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [11 December 2018 12:56 UTC](https://discourse.nodered.org/t/compare-checkbox-checked-value/5671/5 "2018-12-11T12:56:07Z")

</div>

> [@Marooned](#):
>
> Well, from what I know, JS does not allow property names to begin with a number, so that `.0` does not look correct to me.

Correct, but in the mustache template syntax, that is how you reference elements of an array.

---

<div class="post-metadata">

**Author:** ![Marooned](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marooned/32/2858_2.png) [@Marooned](https://discourse.nodered.org/u/Marooned)\
**Post date:** [11 December 2018 13:02 UTC](https://discourse.nodered.org/t/compare-checkbox-checked-value/5671/6 "2018-12-11T13:02:11Z")

</div>

Ok, wasn't aware of reinventing the wheel. Thanks for the clarification.
