Validate email and passwrod before submitting form.