Send value of input text when click on button

how to send value of input text when click on button?
the message is sent directly when I enter a value on input text without clicking the button.

Untitled

1 Like

It goes like this.
image

3 Likes

the code please!
and i use ui_text_input not numeric

1 Like

The flow is in the cookbook
http://cookbook.nodered.org

but you should be able to recreate it just by reading the
names of the change nodes

2 Likes

Example Flow:
image
image
[{"id":"1b2fb300.c26e5d","type":"ui_button","z":"81abceaf.740d","name":"","group":"1f48566b.e8958a","order":3,"width":0,"height":0,"passthru":false,"label":"Summit Button","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"date","topic":"","x":520,"y":680,"wires":[["49d75074.37303"]]},{"id":"49d75074.37303","type":"function","z":"81abceaf.740d","name":"A-B","func":"msg.a=global.get("a") ;\nmsg.b=global.get("b") ;\nmsg.payload = Number((msg.a-msg.b).toFixed(2));\n\nreturn msg;","outputs":1,"noerr":0,"x":670,"y":680,"wires":[["21a1c9af.ba91a6"]]},{"id":"9f2f48ad.8f7838","type":"ui_text_input","z":"81abceaf.740d","name":"","label":"Number B","tooltip":"","group":"1f48566b.e8958a","order":2,"width":0,"height":0,"passthru":true,"mode":"number","delay":300,"topic":"","x":500,"y":780,"wires":[["dec15280.3cbc6"]]},{"id":"dec15280.3cbc6","type":"function","z":"81abceaf.740d","name":"Store to Global Variable b","func":"global.set("b",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":730,"y":780,"wires":[]},{"id":"1373611.8d85b9f","type":"inject","z":"81abceaf.740d","name":"Initial Value","topic":"","payload":"33","payloadType":"num","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":310,"y":740,"wires":[["29981141.09dd9e","9f2f48ad.8f7838"]]},{"id":"29981141.09dd9e","type":"ui_text_input","z":"81abceaf.740d","name":"","label":"Number A","tooltip":"","group":"1f48566b.e8958a","order":1,"width":"5","height":"2","passthru":true,"mode":"number","delay":300,"topic":"","x":500,"y":740,"wires":[["7894de12.4ed5f"]]},{"id":"7894de12.4ed5f","type":"function","z":"81abceaf.740d","name":"Store to Global Variable a","func":"global.set("a",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":730,"y":740,"wires":[]},{"id":"21a1c9af.ba91a6","type":"ui_text","z":"81abceaf.740d","group":"1f48566b.e8958a","order":4,"width":0,"height":0,"name":"","label":"Result","format":"{{msg.payload}} ","layout":"col-center","x":810,"y":680,"wires":},{"id":"1f48566b.e8958a","type":"ui_group","z":"","name":"Group 1","tab":"7f1aa02d.2ce9","order":1,"disp":true,"width":"6","collapse":false},{"id":"7f1aa02d.2ce9","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order":1}]

Have you considered using the form node?

Please read this post for how to share code on the forum so that it is importable. You should go to a new line and click the </> button then paste the code where it says.

[quote="yaquikao, post:5, topic:10015"]

[{"id":"1b2fb300.c26e5d","type":"ui_button","z":"81abceaf.740d","name":"","group":"1f48566b.e8958a","order":3,"width":0,"height":0,"passthru":false,"label":"Summit Button","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"date","topic":"","x":520,"y":680,"wires":[["49d75074.37303"]]},{"id":"49d75074.37303","type":"function","z":"81abceaf.740d","name":"A-B","func":"msg.a=global.get("a") ;\nmsg.b=global.get("b") ;\nmsg.payload = Number((msg.a-msg.b).toFixed(2));\n\nreturn msg;","outputs":1,"noerr":0,"x":670,"y":680,"wires":[["21a1c9af.ba91a6"]]},{"id":"9f2f48ad.8f7838","type":"ui_text_input","z":"81abceaf.740d","name":"","label":"Number B","tooltip":"","group":"1f48566b.e8958a","order":2,"width":0,"height":0,"passthru":true,"mode":"number","delay":300,"topic":"","x":500,"y":780,"wires":[["dec15280.3cbc6"]]},{"id":"dec15280.3cbc6","type":"function","z":"81abceaf.740d","name":"Store to Global Variable b","func":"global.set("b",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":730,"y":780,"wires":[]},{"id":"1373611.8d85b9f","type":"inject","z":"81abceaf.740d","name":"Initial Value","topic":"","payload":"33","payloadType":"num","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":310,"y":740,"wires":[["29981141.09dd9e","9f2f48ad.8f7838"]]},{"id":"29981141.09dd9e","type":"ui_text_input","z":"81abceaf.740d","name":"","label":"Number A","tooltip":"","group":"1f48566b.e8958a","order":1,"width":"5","height":"2","passthru":true,"mode":"number","delay":300,"topic":"","x":500,"y":740,"wires":[["7894de12.4ed5f"]]},{"id":"7894de12.4ed5f","type":"function","z":"81abceaf.740d","name":"Store to Global Variable a","func":"global.set("a",msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":730,"y":740,"wires":[]},{"id":"21a1c9af.ba91a6","type":"ui_text","z":"81abceaf.740d","group":"1f48566b.e8958a","order":4,"width":0,"height":0,"name":"","label":"Result","format":"{{msg.payload}} ","layout":"col-center","x":810,"y":680,"wires":},{"id":"1f48566b.e8958a","type":"ui_group","z":"","name":"Group 1","tab":"7f1aa02d.2ce9","order":1,"disp":true,"width":"6","collapse":false},{"id":"7f1aa02d.2ce9","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order":1}]


@RSURIAGA Thanks for formatting the code, however this topic is almost a year old, and is not really necessary.
I'm closing the topic for now.