set value to input field if option previously selected

Currently if you have a selected option there is just a blank text box, this pull request adds the text from the selected option.