Fix camelCase function and simplify logic to do search on enter in textbox.