create and show templates
made ref number search case insensitive
don't 'submit' reference number if selected_row is not visible
use escape key to close popup
focus first input field of newly inserted rows