hi friends, i have a problem,actually i m calling a ajax function in onBlur() event of a text box and using if statement in a fuction,but the problem that only first if is working,another is not working,i m not getting where i m doing wrong.the code is :
function ajaxFunction(text){
var ajaxRequest; // The variable that makes Ajax possible!
try{
// Opera 8.0+, Firefox, Safari
ajaxRequest = new XMLHttpRequest();
} catch (e){
// Internet Explorer Browsers
try{
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try{
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e){
// Something went wrong
alert("Your browser broke!");
return false;
}
}
}
// Create a function that will receive data sent from the server
ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
var check_order_status=ajaxRequest.responseText;
alert(check_order_status);
if(check_order_status=="order")
{
window.document.form_1.Order_Received.checked=true ;
}
if(check_order_status=="payment")
{
window.document.form_1.Payment_Received.checked=tr ue;
}
if(check_order_status=="stitching")
{
window.document.form_1.Stitching.checked=true;
}
if(check_order_status=="washing")
{
window.document.form_1.Washing.checked=true;
}
if(check_order_status=="packaging")
{
window.document.form_1.packaging.checked=true;
}
if(check_order_status=="delivered")
{
window.document.form_1.Delivered_to_Courier.checke d=true;
}
if(check_order_status =="delivered")
{
window.document.form_1.Delivered_to_Customer.check ed=true;
}
}
}
var status_val=text;
var queryString = "?status=" + status_val;
ajaxRequest.open("POST","get_status.php" + queryString, true);
ajaxRequest.send(null);
}