Using unfocused input with if condition

Hi.
I set an unfocused input but I have to click a search button twice.
What should I do to click the button only once?