travisbrown
Technical User
- Dec 31, 2001
- 1,016
I'm dynamically calling the options for a select. Works in FF, but in IE it won't write the innerhtml. Looks like the values are coming back all right; I can alert the returned values right up to the innerhtml command, just leaves the select with no options. Doesn't seem to raise any errors in IE or FF.
inc_lmcc_trades.asp is just other options, nothing else.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript">
<!--
function createRequestObject() {
var ro;
var browser = navigator.appName;
if(browser == "Microsoft Internet Explorer"){
//ro = new ActiveXObject("Msxml2.XMLHTTP");
ro = new ActiveXObject("Microsoft.XMLHTTP");
}else{
ro = new XMLHttpRequest();
}
return ro;
}
var http = createRequestObject();
function testReq(action,change) {
//alert(action)
http.open('get', 'inc_lmcc_trades.asp?action=' + action );
http.onreadystatechange = function(){
if(http.readyState == 4){
var response = http.responseText;
//alert(response)
//alert(change)
document.getElementById( change ).innerHTML = response;
}
}
http.send(null);
}
function filterList(theElement){
if (document.getElementById( theElement ).value == 0){
testReq(0,theElement);
}
else if(document.getElementById( theElement ).value == -1){
testReq(1,theElement);
}
};
-->
</script>
</head>
<body>
<!-- BEGIN ITEM -->
<select id="lmcctrades" name="trades_0" onchange="filterList(this.id)">
<option value="34">ABSU Call Centre</option>
<option value="73">Apparatus Tester</option>
<option value="38">Backhoes</option>
<option value="54">Cable Splicer</option>
<option value="96">Cable Splicer - Apprentice</option>
<option value="47">Civil Inspectors</option>
<option value="56">CPC</option>
<option value="51">Designer</option>
<option value="58">Disconnect/Reconnect</option>
<option value="93">Distribution Operations Manager</option>
<option value="0">< Show All ></option>
</select>
<!-- END ITEM -->
</body>
</html>
inc_lmcc_trades.asp is just other options, nothing else.