It Don't Reply with the Error Message About the Email Address


#1

Hi, i don't understand why my code doesn't work. It don't reply with the error message about the email address when i write my own address.

var main = function() {
$('form').submit(function() {
var firstName = $('#first').val();
if(firstName === "") {
$('p.first-name-error').text("Please enter your first name.");
}
var lastName = $('#last').val();

if(lastName === "") {
  $('p.last-name-error').text("Please enter your last name.");
}
var email = $('#email').val();

if(email === "") {
$('p.email-error').text("Please enter your email address.");
}
else if(email === "tuvino@hotmail.com") {
$('p.email.error').text("This email is already taken.");

}
var password = $('#password').val();

if(password === "") {
  $('.password-error').text("Please enter a password.");
}
else if(password.length < 8) {
  $('.password-error').text("Short passwords are easy to guess. Try one with at least 8 characters.");
}

	return false;

});

};

$(document).ready(main);


jQuery Projects: Pocketbook, help needed
#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.