You can call a nanoflow event on enter of a text box
And then call a JavaScript action in that nanoflow where you can write your custom javascript code
You can use a JavaScript / HTML snippet and insert custom Javascript there.
The difficulty is that you would need to place an EventListener on that button and have the Javascript be read after that button is rendered in the DOM.