views:

71

answers:

1

my code-

document.getElementById("lblmsg").innerHTML=xmlhttp.responseText;
                if(xmlhttp.responseText == 'Available') 
                    {
                         document.getElementById("newid").value = "";
                    }       

although response text is Available but still it is not going inside if condition???

A: 

Well, that should work.

Are you sure that the response text is exactly Available? Try trimming the response like this:

if(xmlhttp.responseText.trim() == 'Available')

Do you have access to firebug? Try a console.log(xmlhttp) to find out the exact value of the responseText.

alexn