How to work with text input

So add a debug node after the text item. Read this

Yes, only have 1 wire from the button to the function.

Read the built in help...
"Setting msg.enabled to false will disable the button."

Here is an example for you...

[{"id":"b573f57d.6290e8","type":"ui_button","z":"67c3c9f9.a06c78","name":"","group":"1b214600.17935a","order":3,"width":0,"height":0,"passthru":false,"label":"Do stuff","tooltip":"","color":"","bgcolor":"","icon":"","payload":"textInput","payloadType":"flow","topic":"","x":280,"y":340,"wires":[["cc26e2d4.ffd35","b42b2908.665408"]]},{"id":"1330b995.eb0626","type":"ui_text_input","z":"67c3c9f9.a06c78","name":"","label":"","tooltip":"","group":"1b214600.17935a","order":1,"width":0,"height":0,"passthru":true,"mode":"text","delay":"100","topic":"","x":260,"y":280,"wires":[["7ba1f4df.b12a7c","2ffeee02.29d762"]]},{"id":"cc26e2d4.ffd35","type":"function","z":"67c3c9f9.a06c78","name":"my function that does stuff","func":"msg.payload +=  \" - payload modified in my function\"\nreturn msg;","outputs":1,"noerr":0,"x":470,"y":340,"wires":[["bcad70c7.b9db","a0241251.a9cc4"]]},{"id":"bcad70c7.b9db","type":"ui_text","z":"67c3c9f9.a06c78","group":"1b214600.17935a","order":2,"width":0,"height":0,"name":"","label":"Result: ","format":"{{msg.payload}}","layout":"row-left","x":720,"y":340,"wires":[]},{"id":"2ffeee02.29d762","type":"change","z":"67c3c9f9.a06c78","name":"","rules":[{"t":"set","p":"textInput","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":280,"wires":[["fe2d6e02.ad949"]]},{"id":"7ba1f4df.b12a7c","type":"debug","z":"67c3c9f9.a06c78","name":"Text entry debug node","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":460,"y":240,"wires":[]},{"id":"b42b2908.665408","type":"debug","z":"67c3c9f9.a06c78","name":"Button click debug node","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":470,"y":400,"wires":[]},{"id":"fe2d6e02.ad949","type":"switch","z":"67c3c9f9.a06c78","name":"is text empty?","property":"textInput","propertyType":"flow","rules":[{"t":"empty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":640,"y":280,"wires":[["db2479e4.104468"],["fa23a260.4e161"]]},{"id":"db2479e4.104468","type":"change","z":"67c3c9f9.a06c78","name":"enabled false","rules":[{"t":"set","p":"enabled","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":260,"wires":[["eb06ed9d.7f23f"]]},{"id":"fa23a260.4e161","type":"change","z":"67c3c9f9.a06c78","name":"enabled true","rules":[{"t":"set","p":"enabled","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":300,"wires":[["eb06ed9d.7f23f"]]},{"id":"eb06ed9d.7f23f","type":"link out","z":"67c3c9f9.a06c78","name":"","links":["58d47e08.81ffc"],"x":935,"y":280,"wires":[]},{"id":"58d47e08.81ffc","type":"link in","z":"67c3c9f9.a06c78","name":"","links":["eb06ed9d.7f23f"],"x":195,"y":340,"wires":[["b573f57d.6290e8"]]},{"id":"93b54b1c.311778","type":"inject","z":"67c3c9f9.a06c78","name":"Init with empty string","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":160,"y":240,"wires":[["1330b995.eb0626"]]},{"id":"a0241251.a9cc4","type":"debug","z":"67c3c9f9.a06c78","name":"After function debug node","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":770,"y":400,"wires":[]},{"id":"1b214600.17935a","type":"ui_group","z":"","name":"Default","tab":"b8fb94f4.0d31d8","disp":true,"width":"12","collapse":false},{"id":"b8fb94f4.0d31d8","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

In action...
2019-08-15_10-23-16

3 Likes