[jQuery] filter(fn)

[jQuery] filter(fn)


Hi Experts,
I am trying to do something like this;
$("form#submit").submit(function(){
var name = $('#name').attr('value');
var $out = $("#message");
//Send the request
$.ajax({
type: "POST",
url: "post.php",
data: "oname="+name,
complete: function(data){
$out.html(data.responseText);
if(($out).filter(':contains(Invalid)'))
{
$out.fadeIn();
$(".txtHint:visible").slideDown("slow");
$(".client").hide();
}else if($out).filter(':contains(successfull)')){
$out.fadeIn();
}
to be able to determine what to hide and display depending on the
result recieved from the query.
This doesnt not behave as exoected - do any know exactkly what i am
doing wrong here?