# TypedInput Select Box - allways String value

**URL:** <https://discourse.nodered.org/t/typedinput-select-box-allways-string-value/87992>\
**Category:** Developing Nodes\
**Created:** [15 May 2024 18:51 UTC](https://discourse.nodered.org/t/typedinput-select-box-allways-string-value/87992 "2024-05-15T18:51:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjproe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jjproe/32/90972_2.png) [@jjproe](https://discourse.nodered.org/u/jjproe)\
**Post date:** [15 May 2024 18:51 UTC](https://discourse.nodered.org/t/typedinput-select-box-allways-string-value/87992/1 "2024-05-15T18:51:15Z")

</div>

Hello,

I'm trying to get values from the typedInput selectBox as integers in my custom node. These values should be linked to binary operations via the config in the js file. But I am not able to get this value in the flow-file as an integer.

I fill the selectboxes in onprepare:

```auto
const colourSelOff = {type:'num',types:[{options: [{ value: 0, label: "Off"}, { value: 1, label: "Red"},{ value: 2, label: "Green"}, { value: 3, label: "Blue"}, { value: 4, label: "Orange"}]
$("#node-input-ledOnColor0").typedInput(colourSelOff);

```

the defaults are defined as follows:

```auto
defaults: {
            ledOnColor0: {value:0, validate:RED.validators.number(), required: true},
            ledOffColor0: {value:0, validate:RED.validators.number(), required: true},
            ledOnColor1: {value:0, validate:RED.validators.number(), required: true},
            .........

```

But in the flow file it looks like this:  
not changed (default) values integer and those from the typedInput string

```auto
        "ledOnColor0": "1",
        "ledOffColor0": "2",
        "ledOnColor1": 0,
        "ledOffColor1": 0,

```

In the documentation I only ever find examples with string values.  
Do you always have to work with strings in html and convert these values in the js file using parseInt, or is there a direct option with this widget ?

Thanks in advance

---

<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:** [15 May 2024 19:02 UTC](https://discourse.nodered.org/t/typedinput-select-box-allways-string-value/87992/2 "2024-05-15T19:02:16Z")

</div>

Parsing in the runtime is probably the easiest solution.

Alternatively, you could do the conversion in the `oneditsave` function instead.

---

<div class="post-metadata">

**Author:** ![jjproe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jjproe/32/90972_2.png) [@jjproe](https://discourse.nodered.org/u/jjproe)\
**Post date:** [15 May 2024 19:27 UTC](https://discourse.nodered.org/t/typedinput-select-box-allways-string-value/87992/3 "2024-05-15T19:27:40Z")

</div>

Thank you very much for the quick reply!

---

<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:** [14 July 2024 19:28 UTC](https://discourse.nodered.org/t/typedinput-select-box-allways-string-value/87992/4 "2024-07-14T19:28:41Z")

</div>

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