Maybe this should be moved to the Javascript/AJAX forum!
I have the below snippets of code, the problem is i can't get status to pass into the changeCaseStatu s.php page, it just gives a blank value all the time???
show.php
changeCaseStatu s.php
I have the below snippets of code, the problem is i can't get status to pass into the changeCaseStatu s.php page, it just gives a blank value all the time???
show.php
Code:
<script type="text/javascript" language="javascript">
var loading_img = \'../../images/layout/loading.gif\';
var loading_msg = \' Loading Data...\';
var xmlhttp_obj = false;//create the XMLHttpRequest
function ewd_xmlhttp()
{
if (window.XMLHttpRequest)
{ // if Mozilla, Safari etc
xmlhttp_obj = new XMLHttpRequest();
}
else if (window.ActiveXObject)
{ // if IE
try
{
xmlhttp_obj = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlhttp_obj = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
}
}
}
else
{
xmlhttp_obj = false;
}
return xmlhttp_obj;
} //get content via GET
function getcontent(url)
{
var xmlhttp_obj = ewd_xmlhttp();
document.getElementById(containerid).innerHTML = \'<img src="\' + loading_img + \'" />\' + loading_msg;
xmlhttp_obj.onreadystatechange=function()
{
loadpage(xmlhttp_obj);
}
xmlhttp_obj.open(\'GET\', url, true);
xmlhttp_obj.send(null);
alert(xmlHttp.responseText);
window.location.href = \'../../cases/'.$_REQUEST['id'].'/\';
}
function loadpage(xmlhttp_obj, containerid)
{
if ( xmlhttp_obj.readyState == 4 && xmlhttp_obj.status == 200 )
{
document.getElementById(containerid).innerHTML = xmlhttp_obj.responseText;
}
}
//]]>
</script>
...
<select name="status" onchange="getcontent(\'../../sys_config/changeCaseStatus.php?id='.$cid.'&s=\'this.value\');"">'.getCaseStatusList().'</select>
Code:
changeCaseStatus($_GET['id'],$_GET['status']);
Comment