Change order of showing error message and focusing element. In Firefox element lost focus when alert is invoked.