Welcome to the Ranch
You get the text from a text box same way you get the contents of a field from anything else.
It would be a good idea to put some validation of the text between lines 3 and 5, otherwise you have no way of knowing whether the entry in the box is suitable for use.