Javascript validation for SigIn/Register