Hi everyone, first time posting here. I am starting to code with the ajax methodology and am having some trouble. I cannot get my page to update onchange or onblur, well actully I cannot get it to update with any of the on.... commands. Here is my code for my Default.HTML:
Code:
<HTML>
<HEAD>
<script language = "javascript">
var XMLHttpRequestObject = false;
var counter1 = 0
if (window.XMLHttpRequest) {
    XMLHttpRequestObject = new XMLHttpRequest();
    } 
    else if (window.ActiveXObject) {
      XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP");
    }
function updateData(LID, Column, elementsid)
{
  if(XMLHttpRequestObject) {
   var obj = document.getElementById(targetDiv);
   XMLHttpRequestObject.open("POST", "defaultdata.asp");
   XMLHttpRequestObject.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
   XMLHttpRequestObject.onreadystatechange = function()
   {
    if (XMLHttpRequestObject.readyState == 4 &&
    XMLHttpRequestObject.status == 200) {
    obj.innerHTML = XMLHttpRequestObject.responseText;
    }
   }
  var textobject = document.getElementById('elementsid').value	
  XMLHttpRequestObject.send("LID=" + LID + "&Column=" + Column + "&Data=" + textobject);
  }
}
function getData(dataSource, divID)
{
if(XMLHttpRequestObject) {
var obj = document.getElementById(divID);
XMLHttpRequestObject.open("GET", dataSource);
XMLHttpRequestObject.onreadystatechange = function()
{
if (XMLHttpRequestObject.readyState == 4 &&
XMLHttpRequestObject.status == 200) {
obj.innerHTML = XMLHttpRequestObject.responseText;
}
}
XMLHttpRequestObject.send(null);
}
}


</script>
</HEAD>
<body onload = "getData('http://localhost/AJAX/defaultdata.asp','targetDiv')">
<A href="Results.asp" title="Ordered Result list">Results</A> <A href="Printview.asp" title="PrintView">PrintView</A>
<div id="targetDiv">
</div>
</BODY>
</HTML>
And here is the output from defaultdata.asp:
Code:
<Table border="1" width="100%">
<TR><TD><B>Bay</B></TD><TD><B>Rack</B></TD><TD><B>Server</B></TD><TD><B>Tapes Used</B></TD><TD><B>Results</B></TD></TR>

<Form>
<Input Type="hidden" name="LID" value="1079">
<TR><TD>BAY-1</TD>
<TD>C-28</TD>
<TD>AS-RISCBKUP100</TD>
<TD><input type="text" value="TESTTESTTESTTEST" ID=TN73 ondblclick="updateData('73','tapenums', 'TN73')"></TD> <A Name="anchor1079"> </A></TD>
<TD><input type="text" value="dudedudedude" ID=SF73 ondblclick="updateData('73','sfcode', 'SF73')"></TD></TR>
</Form>

<Form>
<Input Type="hidden" name="LID" value="1021">
<TR><TD>BAY-1</TD>
<TD>C-24</TD>
<TD>AS-RISCBKUP101</TD>
<TD><input type="text" value="062" ID=TN50 ondblclick="updateData('50','tapenums', 'TN50')"></TD> <A Name="anchor1021"> </A></TD>
<TD><input type="text" value="" ID=SF50 ondblclick="updateData('50','sfcode', 'SF50')"></TD></TR>
</Form>


</Table>
If needed I can post the ASP code but I know that works because I can put in a url string like this http://localhost/ajax/defaultdata.as...&Column=sfcode
and the page will update as expected. For some reason its seems like the fuction is not being called. the fuction to do the initial onload is working it is the updates that are not.

Any help is appreciated.