# Enable always changing "text input" node

**URL:** https://discourse.nodered.org/t/enable-always-changing-text-input-node/1886
**Category:** Dashboard
**Created:** [28 July 2018 13:54 UTC](https://discourse.nodered.org/t/enable-always-changing-text-input-node/1886 "2018-07-28T13:54:47Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![natanel](https://avatars.discourse-cdn.com/v4/letter/n/e99b99/32.png) [@natanel](https://discourse.nodered.org/u/natanel)
#### Post date: [28 July 2018 13:54 UTC](https://discourse.nodered.org/t/enable-always-changing-text-input-node/1886/1 "2018-07-28T13:54:47Z")

</div>

Hi

the text input only let preset the text of the input field by sending in a msg.payload.  
( doing it once and neglecting any other msg.payload coming in)

I would like **always** to be able to update the text when msg.payload arrive (in) to node  
not only in preset

and also to send any typed text when ENTER pressed (out) from node  
( so input does not sent automatcly as output)

any ideas?

thanks

---

<div class="post-metadata">

### Author: ![davidcgu](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@davidcgu](https://discourse.nodered.org/u/davidcgu)
#### Post date: [28 July 2018 14:16 UTC](https://discourse.nodered.org/t/enable-always-changing-text-input-node/1886/2 "2018-07-28T14:16:40Z")

</div>

Frankly speaking I have several difficulties to understand exactly what u mean, maybe some native english speaker can support u better.

Regarding the second point, on the text input node have you read on the config of the node at the end "Setting Delay to 0 waits for Enter or Tab key, to send input.".

Regards

---

<div class="post-metadata">

### Author: ![natanel](https://avatars.discourse-cdn.com/v4/letter/n/e99b99/32.png) [@natanel](https://discourse.nodered.org/u/natanel)
#### Post date: [28 July 2018 14:39 UTC](https://discourse.nodered.org/t/enable-always-changing-text-input-node/1886/3 "2018-07-28T14:39:51Z")

</div>

Hi  
sorry for my English  
let me try to explain the usage

I have remote eeprom (in mesh network) and would like writing to it and reading from it using the same "text input" node

so  
writing to it using text input and setting time to 0  
entering text --\>pressing enter--\>msg.payload out is holding the text

reading by doing some mesh network command (pressing discovery button in my dashboard)  
msg.payload in is holding the eeprom text--\>"text input" node--\>text shown on screen

the problem that the reading part is done only once at **preset**  
any other reading request (discover) is neglected by the node (text not shown on screen)

how can I change it?  
so always msg.payload in to "text input" node is shown on screen

hope it is more understandable

BR

---

<div class="post-metadata">

### Author: ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)
#### Post date: [28 July 2018 14:42 UTC](https://discourse.nodered.org/t/enable-always-changing-text-input-node/1886/4 "2018-07-28T14:42:50Z")

</div>

As a matter of fact, the input text node from the dashboard always behaves like you want by default. It will not neglect the second and following msg.payload coming in.

However, the msg.payload type has to match the mode type from the dialog configuration dialog.

If they don't math then msg.payload will be "ignored" as you said. For instance, if you configured the _ **mode type** _ as number and send a msg.payload of string type then this msg.payload will not be displayed in the input box.

Below flows shows how it works when payload type matches (first flow) and when it does not match (second flow).

![r-01](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/0/00e2f2fbd71969622db328ac980f3746756a4150.PNG)

Flows:

```auto
[{"id":"4f70e4e8.bb466c","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"113b6d3a.d15a43","type":"ui_text_input","z":"4f70e4e8.bb466c","name":"","label":"","group":"1f75f155.c8269f","order":0,"width":0,"height":0,"passthru":true,"mode":"number","delay":"0","topic":"","x":370,"y":360,"wires":[[]]},{"id":"a6a27da.f141f8","type":"inject","z":"4f70e4e8.bb466c","name":"1 - number","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":130,"y":320,"wires":[["113b6d3a.d15a43"]]},{"id":"8732f101.b6ba7","type":"inject","z":"4f70e4e8.bb466c","name":"","topic":"","payload":"string 2","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":380,"wires":[["113b6d3a.d15a43"]]},{"id":"3d88abda.0c58a4","type":"inject","z":"4f70e4e8.bb466c","name":"3 - string","topic":"","payload":"3","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":440,"wires":[["113b6d3a.d15a43"]]},{"id":"cd4fa537.dfb8f8","type":"ui_text_input","z":"4f70e4e8.bb466c","name":"","label":"","group":"8c30bb65.bd5958","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":"0","topic":"","x":380,"y":120,"wires":[[]]},{"id":"2e27a2e4.77de6e","type":"inject","z":"4f70e4e8.bb466c","name":"string 1","topic":"","payload":"string 1","payloadType":"str","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":140,"y":80,"wires":[["cd4fa537.dfb8f8"]]},{"id":"25295d6a.74eae2","type":"inject","z":"4f70e4e8.bb466c","name":"string 2","topic":"","payload":"string 2","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":140,"wires":[["cd4fa537.dfb8f8"]]},{"id":"5eac910c.abb5a","type":"inject","z":"4f70e4e8.bb466c","name":"string 3","topic":"","payload":"string 3","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":200,"wires":[["cd4fa537.dfb8f8"]]},{"id":"28f2766a.24c87a","type":"inject","z":"4f70e4e8.bb466c","name":"2 - number","topic":"","payload":"2","payloadType":"num","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":130,"y":500,"wires":[["113b6d3a.d15a43"]]},{"id":"1f75f155.c8269f","type":"ui_group","z":"","name":"G2","tab":"76bc2153.6c6be","order":2,"disp":true,"width":"6","collapse":false},{"id":"8c30bb65.bd5958","type":"ui_group","z":"","name":"G1","tab":"76bc2153.6c6be","order":1,"disp":true,"width":"6","collapse":false},{"id":"76bc2153.6c6be","type":"ui_tab","z":"","name":"LAB","icon":"dashboard"}]

```

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [28 July 2018 14:52 UTC](https://discourse.nodered.org/t/enable-always-changing-text-input-node/1886/5 "2018-07-28T14:52:38Z")

</div>

The text input should always set the displayed text to any value passed to it via msg.payload. That is what is meant by presetting it. Messages can be passed to it at any time.  
You probably want to disable message pass through in the node.  
To prevent it sending a message until enter is pressed then set the delay to 0 (as described at the bottom of the config screen. See this flow for example of how it should work.

```auto
[{"id":"5c2c4e08.df4238","type":"ui_text_input","z":"acd8202b.36972","name":"","label":"","group":"b7868331.17d03","order":0,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"","x":229.5,"y":1229,"wires":[["9873918b.33e59"]]},{"id":"e64c1839.afef3","type":"inject","z":"acd8202b.36972","name":"","topic":"","payload":"some input","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":87,"y":1231,"wires":[["5c2c4e08.df4238"]]},{"id":"9873918b.33e59","type":"debug","z":"acd8202b.36972","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":418,"y":1229,"wires":[]},{"id":"3dae93b9.60d4b4","type":"inject","z":"acd8202b.36972","name":"","topic":"","payload":"other input","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":84,"y":1310,"wires":[["5c2c4e08.df4238"]]},{"id":"b7868331.17d03","type":"ui_group","z":"","name":"Insert Data Test","tab":"54d30b5d.781dfc","order":1,"disp":true,"width":"6"},{"id":"54d30b5d.781dfc","type":"ui_tab","z":"","name":"Input Test","icon":"dashboard","order":3}]

```

---

<div class="post-metadata">

### Author: ![natanel](https://avatars.discourse-cdn.com/v4/letter/n/e99b99/32.png) [@natanel](https://discourse.nodered.org/u/natanel)
#### Post date: [28 July 2018 15:21 UTC](https://discourse.nodered.org/t/enable-always-changing-text-input-node/1886/6 "2018-07-28T15:21:36Z")

</div>

> [@Andrei](#):
>
> [{"id":"4f70e4e8.bb466c","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"113b6d3a.d15a43","type":"ui\_text\_input","z":"4f70e4e8.bb466c","name":"","label":"","group":"1f75f155.c8269f","order":0,"width":0,"height":0,"passthru":true,"mode":"number","delay":"0","topic":"","x":370,"y":360,"wires":[]},{"id":"a6a27da.f141f8","type":"inject","z":"4f70e4e8.bb466c","name":"1 - number","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":130,"y":320,"wires":[["113b6d3a.d15a43"]]},{"id":"8732f101.b6ba7","type":"inject","z":"4f70e4e8.bb466c","name":"","topic":"","payload":"string 2","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":380,"wires":[["113b6d3a.d15a43"]]},{"id":"3d88abda.0c58a4","type":"inject","z":"4f70e4e8.bb466c","name":"3 - string","topic":"","payload":"3","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":440,"wires":[["113b6d3a.d15a43"]]},{"id":"cd4fa537.dfb8f8","type":"ui\_text\_input","z":"4f70e4e8.bb466c","name":"","label":"","group":"8c30bb65.bd5958","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":"0","topic":"","x":380,"y":120,"wires":[]},{"id":"2e27a2e4.77de6e","type":"inject","z":"4f70e4e8.bb466c","name":"string 1","topic":"","payload":"string 1","payloadType":"str","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":140,"y":80,"wires":[["cd4fa537.dfb8f8"]]},{"id":"25295d6a.74eae2","type":"inject","z":"4f70e4e8.bb466c","name":"string 2","topic":"","payload":"string 2","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":140,"wires":[["cd4fa537.dfb8f8"]]},{"id":"5eac910c.abb5a","type":"inject","z":"4f70e4e8.bb466c","name":"string 3","topic":"","payload":"string 3","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":200,"wires":[["cd4fa537.dfb8f8"]]},{"id":"28f2766a.24c87a","type":"inject","z":"4f70e4e8.bb466c","name":"2 - number","topic":"","payload":"2","payloadType":"num","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":130,"y":500,"wires":[["113b6d3a.d15a43"]]},{"id":"1f75f155.c8269f","type":"ui\_group","z":"","name":"G2","tab":"76bc2153.6c6be","order":2,"disp":true,"width":"6","collapse":false},{"id":"8c30bb65.bd5958","type":"ui\_group","z":"","name":"G1","tab":"76bc2153.6c6be","order":1,"disp":true,"width":"6","collapse":false},{"id":"76bc2153.6c6be","type":"ui\_tab","z":"","name":"LAB","icon":"dashboard"}]

OK  
following your example I can get the same problem

follow this

GOOD  
inject "string 1" --\> inject "string 2" --\> inject "string 3" - all ok

GOOD  
inject "string 1" --\> go to dash board --\> change text to "string" (backspace twice, do not press enter or tab) --\> inject "string 2" --\> inject "string 3" - all ok

ERROR  
inject "string 1" --\> go to dash board --\> change text to "string" (backspace twice, do not press enter or tab) --\> inject "string 1" --\> no change in dash board still "string", should be "string 1"

summery : changing the string in dashboard and re-inject it, does not reset the string to it's original

is it only in my setup or you also got it

thanks

---

<div class="post-metadata">

### Author: ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)
#### Post date: [28 July 2018 15:39 UTC](https://discourse.nodered.org/t/enable-always-changing-text-input-node/1886/7 "2018-07-28T15:39:33Z")

</div>

Hi, I was able to reproduce what you described. Looks like the issue happens only when msg.payload arrives while you are editing the input field.

 ![dashbaord-01](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/e/e835ae6795f9e81b3b42e4c14adc49fbd3bd329c.gif)

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [28 July 2018 15:40 UTC](https://discourse.nodered.org/t/enable-always-changing-text-input-node/1886/8 "2018-07-28T15:40:35Z")

</div>

> [@Andrei](#):
>
> Looks like the issue happens only when msg.payload arrives while you are editing the input field.

I would say that is desirable behaviour. The user would not expect the text he is entering to suddenly change while he is entering it.

---

<div class="post-metadata">

### Author: ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)
#### Post date: [28 July 2018 15:44 UTC](https://discourse.nodered.org/t/enable-always-changing-text-input-node/1886/9 "2018-07-28T15:44:24Z")

</div>

> [@Colin](#):
>
> I would say that is desirable behavior. The user would not expect the text he is entering to suddenly change while he is entering it.

Indeed, it makes sense. Fully agree, Colin.

---

<div class="post-metadata">

### Author: ![natanel](https://avatars.discourse-cdn.com/v4/letter/n/e99b99/32.png) [@natanel](https://discourse.nodered.org/u/natanel)
#### Post date: [28 July 2018 15:52 UTC](https://discourse.nodered.org/t/enable-always-changing-text-input-node/1886/10 "2018-07-28T15:52:47Z")

</div>

I am dealing with user interface few years and mesh iot network for few month

If you put your self in the user side with time set to 0, change Sent only in enter

Changing names of remote mesh nodes  
Does not send enter yet but stoped entering text ( some time getting out for few hours or shift change and new user arraive)  
Regret the chage and like to reread the original name  
Problem

This is common beave, there is not any problem in re sending the same string and expect it to Display

---

<div class="post-metadata">

### Author: ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)
#### Post date: [28 July 2018 15:59 UTC](https://discourse.nodered.org/t/enable-always-changing-text-input-node/1886/11 "2018-07-28T15:59:15Z")

</div>

Just to be more precise, since I overlooked the case #2. The change will NOT occur if you are entering new text AND the arriving msg.payload is equal to the previous one.

If you are editing the text and the msg.payload that arrives is different from the previous one then the new text will be displayed.

Considering the above, if you are editing the text and the same old text just arrives you would not want to lose your ongoing work, right ?

---

<div class="post-metadata">

### Author: ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)
#### Post date: [28 July 2018 16:14 UTC](https://discourse.nodered.org/t/enable-always-changing-text-input-node/1886/12 "2018-07-28T16:14:44Z")

</div>

> [@natanel](#):
>
> Regret the chage and like to reread the original name

This could happen after you change the data and press enter. Could be solved with some additional logic, e.g. storing the previous value and restoring with a button. The ui input text is quite smart already but if you want some specific behavior then additional logic will be required.

---

<div class="post-metadata">

### Author: ![natanel](https://avatars.discourse-cdn.com/v4/letter/n/e99b99/32.png) [@natanel](https://discourse.nodered.org/u/natanel)
#### Post date: [28 July 2018 19:56 UTC](https://discourse.nodered.org/t/enable-always-changing-text-input-node/1886/13 "2018-07-28T19:56:34Z")

</div>

Hi  
found a workaround / solution

during the string update (reading from remote eeprom)

changing "string2" to "string" (backspace, do not press enter or tab) -\>  
request read from remote eeprom -\> text input node is disabled -\>  
**somehow** string is changed to original "string2" and disabled -\>  
got eeprom data -\> text input node is enabled

so if string is not changed I am getting the origianl "string2" ( which is good)

Andrei and Colin  
thanks for you help
