Help with `text input` node

I'm working on a small project just to keep myself busy.

I have a text input node.

Normally it is disabled.

When enabled (for a short time) the user enters text.
After that time the node is disabled, and the text entered is retained. :frowning:

How can I wipe the text?
If I send a msg.payload == " " it messes up the next time the node is enabled as it has (remembers) the space sent previously.

Thanks in advance.

Have you tried

msg.payload = ""

1 Like

How do I do that in a change node?

I fear that if I make msg.payload text and put "", I will get just that.

Update:

So I set it with J: (expression) - yes?

In the change node, leave the value blank
Screen Shot 2022-10-07 at 6.29.16 AM

and it is easy enough to test...

[{"id":"663ce662753eca2f","type":"change","z":"ea4605c08dd40eb0","name":"Refresh Browser","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"},{"t":"delete","p":"socketid","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":240,"wires":[["61d5cc7260ed2658"]]},{"id":"61d5cc7260ed2658","type":"debug","z":"ea4605c08dd40eb0","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":810,"y":240,"wires":[]},{"id":"32c524c6e4f3d416","type":"inject","z":"ea4605c08dd40eb0","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"blah","payloadType":"str","x":370,"y":240,"wires":[["663ce662753eca2f"]]}]
2 Likes

Thanks.

Silly me. I didn't think of that.

Works.

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