How do I?: Button triggers text (number) field value to be sent in payload

Running NR on Windows 10/Chrome

Trying to have a button trigger the output of numeric text input field. (actually I want data from two text fields combined in a json payload and output when the button is pressed, but I am starting with one to keep it simple for now)

I connected the output of a button to the input of the text box
If 'pass through' is checked, the button's message is passed through, the text box's contents is not. As one might expect. If pass through is not checked, I get nothing out.

Changing the value of the text input directly also has the expected behavior: I get the text value out, either immediately or after a TAB depending on whether DELAY = 0 or not.

What I want is to get the value of the text input out when a button is pressed.
Can someone tell me how to do this?
-Thanks

Not sure exactly what the flow is used for but it sounds like you want to input 2 values and then send them together ?

If so the you should use the form node

image

Thank you - From node sounds like what I need. The submit button will grab the value(s) and send them in a message. Will try tomorrow. !

Let me know how you get on :wink:

The Form node doesn't quite do what I wanted.

I don't want a CANCEL button since there is no dialog box being dismissed. Also I cant figure out how you got the two input fields to layout side by side in your pic. Mine fill the whole width of the container and stack vertically. Perhaps these things can be controlled with some CSS or something I am not familiar with...

Alternately, is there any way to have a button trigger the regular text input node to report its value?

Thanks

Leave the Cancel button label empty to get rid of it.
And check the checkbox to get column based layout.

Hmmm None of that works.
Maybe I have an old version of node-red. Checking on how to upgrade...

After updating the form node to latest, it looks just like yours. Thanks for your help !

1 Like

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