This ajax is called from an onclick in a form element. I want to use one call to change 2 different elements. Is there a way to change the contents of another element at the same time, not just list_id? I'm having a tough time getting my head around js. and have tried lots of different things with no luck :(
Thanks!
Thanks!
Code:
function save_edit_row(list, value)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
var url="save_edit_row.php"
url=url+"?list="+list
url=url+"&row_num="+row_num
url=url+"&value="+value
url=url+"&rand="+Math.random()
xmlHttp.onreadystatechange=list_stateChange
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function list_stateChange()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById('list_id').innerHTML=xmlHttp.responseText
}
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
//Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
Comment