# How does to fix node validation error, when it get value from TypedInput Select box?

**URL:** <https://discourse.nodered.org/t/how-does-to-fix-node-validation-error-when-it-get-value-from-typedinput-select-box/61375>\
**Category:** Developing Nodes\
**Created:** [16 April 2022 22:41 UTC](https://discourse.nodered.org/t/how-does-to-fix-node-validation-error-when-it-get-value-from-typedinput-select-box/61375 "2022-04-16T22:41:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![studiobox](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/studiobox/32/55766_2.png) [@studiobox](https://discourse.nodered.org/u/studiobox)\
**Post date:** [16 April 2022 22:41 UTC](https://discourse.nodered.org/t/how-does-to-fix-node-validation-error-when-it-get-value-from-typedinput-select-box/61375/1 "2022-04-16T22:41:15Z")

</div>

Hi all,

I create node. And it has validate function for its field.

Validation has using value from 'TypedInput Select box'. They names 'node-input-action' and 'node-input-datetimeMode'. But the problem is from 'node-input-datetimeMode'.

Please see below

```auto
datetimeInitialDate: {
    value: "",
    validate: function (v) {
        if ($("#node-input-action").typedInput('value') === ACTION_DATETIMEPICKER) {
            if ($("#node-input-datetimeMode").typedInput('value') === DATETIME_MODE_DATETIME || $("#node-input-datetimeMode").typedInput('value') === DATETIME_MODE_DATE) {
                if (!v.match(/^\s*$/)) {
                    const result = isValidDate(v);
                    return result;
                } else {
                    return true;
                }
            } else {
                return true;
            }
        } else {
            return true;
        }
    }
}

```

After I run flow on browser, the client error is occured.

```auto
Validation error: node-line-bot-quick-reply-item 3f71c1a2ce19ff2a property: datetimeInitialDate value: Error: cannot call methods on typedInput prior to initialization; attempted to call method 'value'
    at Function.error (vendor.js?v=2.2.2:2:2589)
    at HTMLInputElement.<anonymous> (vendor.js?v=2.2.2:10:5615)
    at Function.each (vendor.js?v=2.2.2:2:2976)
    at s.fn.init.each (vendor.js?v=2.2.2:2:1454)
    at s.fn.init.t.fn.<computed> [as typedInput] (vendor.js?v=2.2.2:10:5357)
    at Object.validate (<anonymous>:316:59)
    at a (red.min.js?v=2.2.2:18:373999)
    at i (red.min.js?v=2.2.2:18:374649)
    at v (red.min.js?v=2.2.2:18:374357)
    at HTMLInputElement.<anonymous> (red.min.js?v=2.2.2:18:375995)

```

**So how does to fix node validati error, when it get value from TyponedInput Select box?** 🤔

Moreover, I guest when I remove only code for reading 'node-input-datetimeMode' value, reading 'node-input-action' value is not error. 🤔

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [15 June 2022 22:42 UTC](https://discourse.nodered.org/t/how-does-to-fix-node-validation-error-when-it-get-value-from-typedinput-select-box/61375/2 "2022-06-15T22:42:12Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
