Hello,
trying to reload a div tag but for some reason i cant get through the if response == success statement.
According to consolLog success is returned but it keeps buy passes the if response == success and i cant seem to pin pint why the if statement isnt evaluated. any ideas?
$(document).ready(function() { /// Wait till page is loaded
$('#idSel_project').change(function(){
var prjid = $("#idSel_project").val();
if (prjid == '') {
$('.success').fadeOut(200);
$('.error').fadeIn(200);
} //END of checking prjid variable
else {
$.ajax(
{ type: "POST",
url: 'phpFile.php',
data: $('#testForm').serialize(),
success: function(response){
**console.log("Stage 1 resp:: "+ response);**
if(response == 'success') {
$('.success').fadeIn(200).show();
$('.error').fadeOut(200).hide();
**console.log("Stage 2: "+ response);**
$("#prjid").val("");
} // end of if statement
else {
$('.success').fadeOut(200);
$('.error').fadeIn(200);
} //end of else statement
},//end of success function
error: function() {
$('.success').fadeOut(200);
$('.error').fadeIn(200);
}// end of error function
});//end of ajax statement and begining of type: post
}//END of else statement if it pass the field empty check
return false;
}); //End of change function
}); // End of ready function - Wait till page is loaded