# Value.length pada element #datePicker ada kesalahan

**URL:** <https://forum.wixstudio.com/t/value-length-pada-element-datepicker-ada-kesalahan/57575>\
**Category:** Ask the community\
**Tags:** code\
**Created:** [March 27, 2024, 8:23am UTC](https://forum.wixstudio.com/t/value-length-pada-element-datepicker-ada-kesalahan/57575 "2024-03-27T08:23:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bagus](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bagus/32/20814_2.png) [@bagus](https://forum.wixstudio.com/u/bagus)\
**Post date:** [March 27, 2024, 8:23am UTC](https://forum.wixstudio.com/t/value-length-pada-element-datepicker-ada-kesalahan/57575/1 "2024-03-27T08:23:50Z")

</div>

![Screenshot 2024-03-27 151938](https://us1.discourse-cdn.com/wix/original/3X/c/9/c9f483f9372b73b0222f368b76cab31975ecb782.png)

```javascript
$w.onReady( function () {
$w('#dropdown1, #inputNama, #dateSewa, #dropdown2, #dropdown3, #inputTujuan').onChange(function () {
        if ($w('#dropdown1').value.length > 0 && $w('#inputNama').value.length > 0 && $w('#dateSewa').value.length > 0 
		&& $w('#dropdown2').value.length > 0 && $w('#dropdown3').value.length > 0 && $w('#inputTujuan').value.length > 0) {
            $w('#buttonNext1').enable();
        } else { $w('#buttonNext1').disable(); }
});

```

---

<div class="post-metadata">

**Author:** ![anthony](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/anthony/32/79536_2.png) [@anthony](https://forum.wixstudio.com/u/anthony)\
**Post date:** [March 28, 2024, 8:01pm UTC](https://forum.wixstudio.com/t/value-length-pada-element-datepicker-ada-kesalahan/57575/2 "2024-03-28T20:01:40Z")

</div>

What is the value of `$w('#dateSewa').value`? Is it null? Does it have a length?

---

<div class="post-metadata">

**Author:** ![bagus](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bagus/32/20814_2.png) [@bagus](https://forum.wixstudio.com/u/bagus)\
**Post date:** [March 29, 2024, 3:08am UTC](https://forum.wixstudio.com/t/value-length-pada-element-datepicker-ada-kesalahan/57575/3 "2024-03-29T03:08:43Z")

</div>

it is a #datapicker element, not text

---

<div class="post-metadata">

**Author:** ![anthony](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/anthony/32/79536_2.png) [@anthony](https://forum.wixstudio.com/u/anthony)\
**Post date:** [March 29, 2024, 2:24pm UTC](https://forum.wixstudio.com/t/value-length-pada-element-datepicker-ada-kesalahan/57575/4 "2024-03-29T14:24:40Z")

</div>

Since this `value` is a `Date` object it won’t have a `length` property. When Datepickers don’t have a date set then `value` is `null` so you can change that part to `$w('#dateSewa').value` and it should work:

```js
$w.onReady( function () {
$w('#dropdown1, #inputNama, #dateSewa, #dropdown2, #dropdown3, #inputTujuan').onChange(function () {
        if ($w('#dropdown1').value.length > 0 && $w('#inputNama').value.length > 0 && $w('#dateSewa').value 
		&& $w('#dropdown2').value.length > 0 && $w('#dropdown3').value.length > 0 && $w('#inputTujuan').value.length > 0) {
            $w('#buttonNext1').enable();
        } else { $w('#buttonNext1').disable(); }
});

```

---

<div class="post-metadata">

**Author:** ![bagus](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bagus/32/20814_2.png) [@bagus](https://forum.wixstudio.com/u/bagus)\
**Post date:** [March 31, 2024, 1:17pm UTC](https://forum.wixstudio.com/t/value-length-pada-element-datepicker-ada-kesalahan/57575/5 "2024-03-31T13:17:54Z")

</div>

Thank you, your information is very helpful to me. Terimakasih…
