[eluser]barisv[/eluser]
Hi,
I am filling a form and echo out a true or false according to a function.
Code:
$.ajax({
url: "<?php echo site_url('admin/addnews'); ?>",
type: 'POST',
data: form_data,
success: function(msg) {
alert(msg);
if(msg == 'true')
{
$('.fail').remove();
$('.success').fadeIn(500);
$('#name').attr("readOnly", "readonly");
$('#message').attr("readOnly", "readonly");
$('#submit').attr("readOnly","readonly");
}
else
{
$('.fail').hide().fadeIn(500);
}
}
});
Even if the alert method returns true, it enters the else part. What can be the problem ?
Thanks in advance.