# Set value of a checkbox from field in database

**URL:** <https://forum.wixstudio.com/t/set-value-of-a-checkbox-from-field-in-database/22901>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [April 7, 2019, 8:37am UTC](https://forum.wixstudio.com/t/set-value-of-a-checkbox-from-field-in-database/22901 "2019-04-07T08:37:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![justindehaas](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@justindehaas](https://forum.wixstudio.com/u/justindehaas)\
**Post date:** [April 7, 2019, 8:37am UTC](https://forum.wixstudio.com/t/set-value-of-a-checkbox-from-field-in-database/22901/1 "2019-04-07T08:37:00Z")

</div>

I want to connect a checkbox value (not the state!) to a field in a database. So that the value of the field appears next to the checkbox.

I found some code but it does’t work. Anybody has a better suggestion?

$w.onReady(function () {  
$w(“#date1Checkbox”).value = $w(‘#dynamicDataset’).getCurrentItem().date1

![](https://us1.discourse-cdn.com/wix/original/3X/4/e/4ee795f3c7427ccd95171a28a1ab8cd6b29d7333.png)
