How to work with text input

I'm trying to create a dashboard that will worked with text input and a button
and will trigger a function that will do something.
I'm not able to find on which object the text is saved and I how am dealing it in the function.
Also, is there a way that the function will be triggered only when the button is pressed?
Is there a way that the button will be disable as long no data entered?

If you posted your flow, it would be easier to help you...

But in general the dashboard nodes explain how the data is sent in the info panel of the node ( usually msg.payload)

If you use the form node it is only sent when the button is pressed

In basic this is how i want my flow to look like:

[{"id":"e5e03e58.27ca4","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"73623a38.af8454","type":"ui_button","z":"e5e03e58.27ca4","name":"","order":0,"width":0,"height":0,"passthru":false,"label":"button","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":480,"y":700,"wires":[["4e2e9bd0.471994"]]},{"id":"da86512d.2f4bd","type":"ui_text_input","z":"e5e03e58.27ca4","name":"","label":"","tooltip":"","order":0,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"","x":460,"y":640,"wires":[["4e2e9bd0.471994"]]},{"id":"4e2e9bd0.471994","type":"function","z":"e5e03e58.27ca4","name":"","func":"\nreturn msg;","outputs":1,"noerr":0,"x":720,"y":700,"wires":[["54b13780.debd08"]]},{"id":"54b13780.debd08","type":"ui_text","z":"e5e03e58.27ca4","order":0,"width":0,"height":0,"name":"","label":"text","format":"{{msg.payload}}","layout":"row-spread","x":960,"y":720,"wires":[]}]

What I need to do inside the function?
I don't want to add another form

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