You are here

Validate field only when is not empty

confirmEmailAddress: {
          email: true,
          equalTo: {
              param: '#emailAddress',
              depends: function(element) { //This is the dependent option
                  return $("#confirmEmailAddress").val().length > 0;
                }
            }
        }
code type: