With the text input box you ask for the new text.
When the user clicks ok, you set button text to the new text.