Adding the function which allows to create a text field