How can I prevent tab to be switched over without filling out required fields?