# TypedInput with fix value list and "msg" option

**URL:** <https://discourse.nodered.org/t/typedinput-with-fix-value-list-and-msg-option/11503>\
**Category:** Developing Nodes\
**Created:** [24 May 2019 13:01 UTC](https://discourse.nodered.org/t/typedinput-with-fix-value-list-and-msg-option/11503 "2019-05-24T13:01:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![NetHans](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nethans/32/2843_2.png) [@NetHans](https://discourse.nodered.org/u/NetHans)\
**Post date:** [24 May 2019 13:01 UTC](https://discourse.nodered.org/t/typedinput-with-fix-value-list-and-msg-option/11503/1 "2019-05-24T13:01:11Z")

</div>

Hi,

I need a TypedInput with a fix valuelist in default. But I would like to give the alternativ option to set the value by the msg object.

I need help by the implementation.

```auto
    <div class="form-row">
        <label for="node-input-direction" style="width: 130px;"><i class="fa fa-tag"></i> <span>direction</span></label>
        <input type="text" id="node-input-direction">
        <input type="hidden" id="node-input-directionType"></input>
    </div>

```

```auto
     defaults: {
        name: { value: "" },
        direction: { value: "input" },
        directionType: { value: "str", options:["input","output"] }
    },

```

```auto
    oneditprepare: function () {
        var node = this;

        $("#node-input-direction").typedInput({
            default: 'str',
            types: ["str", "msg"],
            typeField: $("#node-input-directionType")
        })
    }

```

My source code does not deliver the desired result.  
What can I do to get by default a value list like the boolean type and the msg option as alternativ?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [25 May 2019 17:07 UTC](https://discourse.nodered.org/t/typedinput-with-fix-value-list-and-msg-option/11503/2 "2019-05-25T17:07:52Z")

</div>

Where you specify `types` you need to use an object instead of `'str'`. See the `types` example here ...

> <https://github.com/node-red/node-red/issues/1549>

---

<div class="post-metadata">

**Author:** ![NetHans](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nethans/32/2843_2.png) [@NetHans](https://discourse.nodered.org/u/NetHans)\
**Post date:** [26 May 2019 09:55 UTC](https://discourse.nodered.org/t/typedinput-with-fix-value-list-and-msg-option/11503/3 "2019-05-26T09:55:27Z")

</div>

Thank you very much for the solution of my problem.

It would be nice if the example of GitHub can be included in the [documentation](https://nodered.org/docs/api/ui/typedInput/#types-typedefinition) (@knolleary) . In this way it would be easier to work in the TypeDefinition.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [26 May 2019 10:06 UTC](https://discourse.nodered.org/t/typedinput-with-fix-value-list-and-msg-option/11503/4 "2019-05-26T10:06:34Z")

</div>

(hint) - we accept pull request for docs as well as code
