Javascript user validation is working