In this section you seem to be comparing two jquery objects instead of their values:
if(p1 != p2){
passmatcherror.fadeIn(750);
p1.addClass("needsfilled");
p2.addClass("needsfilled");
}
what happens if you change it to
if(p1.val() !== p2.val()){
passmatcherror.fadeIn(750);
p1.addClass("needsfilled");
p2.addClass("needsfilled");
}