Fill the input field with the last query and select the text