Password and email problems


#1


https://www.codecademy.com/courses/jquery-ext/projects/jquery-prj_pocketbook


I'm not getting error message for short password, and email match.


Replace this line with your code. 
var main = function() {
  $('form').submit(function() {
    var firstName = $('#first').val();
    
    if(firstName === "") {
      $('.first-name-error').append('Please enter your first name.');
    }

    return false;
  });
  var lastName = $('#last').val();
  if(lastName === ''){
    $('.last-name-error').append('Please enter your last name.');
  };
  var email = $('#email').val();
  if(email === ""){
    $('.email-error').append('Please enter your email address.');
  }else if(email === "taken@yahoo.com"){
    $('.email-error').append('This email is already taken.');
  };
  var passw = $('#password').val();
  if (passw === ''){
    $('.password-error').append('Please enter a password');
  }else if (passw.length < 8){
    $('.password-error').append('Short passwords are easy to guess. Try one with at least 8 characters.');
  };
  return false;
};

$(document).ready(main);


#2

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