Javascript validating username and password with database