I have a hidden span within a table column and I cannot unhide it using style.display='block' ??
Sample code
<table>
<tr>
<td><input name="status" value=""></td><td><input type="button" value="search" onClick="searchByStatus()"></td>
<td><div id="MySpan" Style="display:none"><img src="ajaxprogressindicator.gif"></div></td>
</tr>
</table>
var xmlHttp = new ActiveXObject("MSXML2.XMLHTTP");
function searchByStatus(){
var f=document.forms[0];
var key =f.status.value;
if(key==''){
alert("Please select a status");
return;
}
MySpan.style.display='block';
var url = "/"+document.forms[0].getdbpath.value+"/StatusSearch?OpenAgent";
pdata="&a="+key;
xmlHttp.open("POST",url,false);
xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length",pdata.length);
xmlHttp.setRequestHeader("Connection","close");
xmlHttp.onreadystatechange = processSearchXML
xmlHttp.send(pdata)
}
I have used a similar method in the past. the location of the span, inside or outside of the table does not seem to matter.
I have got the image to appear by placing an alert after the line:
MySpan.style.display='block';.
Maybe this has something to do with a small result set, but in the past with only one result I still saw the image flicker and in this case I am returning over 25 results from the server.