# Node property resets itself

**URL:** <https://discourse.nodered.org/t/node-property-resets-itself/46866>\
**Category:** Developing Nodes\
**Created:** [8 June 2021 16:52 UTC](https://discourse.nodered.org/t/node-property-resets-itself/46866 "2021-06-08T16:52:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hkayan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hkayan/32/42713_2.png) [@hkayan](https://discourse.nodered.org/u/hkayan)\
**Post date:** [8 June 2021 16:52 UTC](https://discourse.nodered.org/t/node-property-resets-itself/46866/1 "2021-06-08T16:52:23Z")

</div>

Hi,

My custom node property resets itself after re-opening it to reconfigure.  
I am editing it as it is seen in the below image.

![ss1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/6/5646a55ecf79217e99b412362d8454dad369397a.png)

But if I re-open it after deploying, the **Search for** property resets itself to **All** as seen in the below picture.

![ss2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/f/cff528f852d2854127f30a3e9aeed593cde30d50.png)

While the **Output** property does not show this behaviour.

Here is the code for the related part.

```auto
defaults: {
            name: {value:""},
            searchFor: {value:""},
            searchForType: {value: ""},
            output: {value:""},
            outputType: {value: ""}
        },

/////somethings////////
oneditprepare: function() {
            $("#node-input-searchFor").typedInput({
                types:[
                    {
                        value: "All",
                        label: "All",
                        hasValue: false
                    },
                    {
                        value: "Name",
                        label: "Local Name"
                    }],
                typeField: "#node-input-searchForType"
            });
            $("#node-input-output").typedInput({
                types:[
                    {
                        value: "Peripheral",
                        label: "",
                        options: ["MAC", "Peripheral", "Data"]
                    }],
                typeField: "#node-input-searchForType"
            });
        }

```

It seems like I need to define a custom behaviour as it is explained [here.](https://nodered.org/docs/creating-nodes/properties) I would appreciate any hint on this.

---

<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:** [8 June 2021 16:56 UTC](https://discourse.nodered.org/t/node-property-resets-itself/46866/2 "2021-06-08T16:56:51Z")

</div>

> [@hkayan](#):
>
> `typeField: "#node-input-searchForType"`

Try

```auto
typeField: $("#node-input-searchForType")

```

Also, have you created a hidden input for `node-input-searchForType`?

---

<div class="post-metadata">

**Author:** ![hkayan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hkayan/32/42713_2.png) [@hkayan](https://discourse.nodered.org/u/hkayan)\
**Post date:** [8 June 2021 17:02 UTC](https://discourse.nodered.org/t/node-property-resets-itself/46866/3 "2021-06-08T17:02:49Z")

</div>

Hi @Steve-Mcl,

Yes I created hidden inputs. I have realized thanks to you that `typeField: "#node-input-searchForType"` for the `node-input-output` was wrong. I have changed it to `typeField: "#node-input-outputType"` and it works pretty well.

---

<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:** [22 June 2021 17:03 UTC](https://discourse.nodered.org/t/node-property-resets-itself/46866/4 "2021-06-22T17:03:05Z")

</div>

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