Hello! I saw some pretty competent people replying here so I`ll post my question. This is my HTML code:
[code]
<select size=”5″ name=”model”>
<optgroup label=”Class C”>
<option onclick=”javascript:ajaxpage(‘http://test.rentabenz.ro/images/cars/g.php?c=c-2001’, ‘img_right’);” value=”C 2001-2003″>Model 2001-2003</option>
<option onclick=”javascript:ajaxpage(‘http://test.rentabenz.ro/images/cars/g.php?c=c-2004’, ‘img_right’);” value=”C 2004-2007″>Model 2004-2007</option>
</optgroup>
<optgroup label=”Class E”>
<option onclick=”javascript:ajaxpage(‘http://test.rentabenz.ro/images/cars/g.php?c=e-2001’, ‘img_right’);” value=”E 2001-2003″>Model 2001-2003</option>
<option onclick=”javascript:ajaxpage(‘http://test.rentabenz.ro/images/cars/g.php?c=e-2004’, ‘img_right’);” value=”E 2004-2007″>Model 2004-2007</option>
</optgroup>
<optgroup label=”Class S”>
<option onclick=”javascript:ajaxpage(‘http://test.rentabenz.ro/images/cars/g.php?c=s-2001’, ‘img_right’);” value=”S 2001-2003″>Model 2001-2003</option>
</optgroup>
<optgroup label=”Class V”>
<option onclick=”javascript:ajaxpage(‘http://test.rentabenz.ro/images/cars/g.php?c=v-2001’, ‘img_right’);” value=”V 2001-2003″>Model 2001-2003</option>
<option onClick=”javascript:ajaxpage(‘http://test.rentabenz.ro/images/cars/g.php?c=v-2004’, ‘img_right’);” value=”V 2003-2007″>Model 2004-2007</option>
</optgroup>
</select><br />
And this is the Javascript:
[code]
var loadedobjects=””
var rootdomain=”http://”+window.location.hostname
function ajaxpage(url, containerid){
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject(“Msxml2.XMLHTTP”)
}
catch (e){
try{
page_request = new ActiveXObject(“Microsoft.XMLHTTP”)
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid)
}
page_request.open(‘GET’, url, true)
page_request.send(null)
}
function loadpage(page_request, containerid){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf(“http”)==-1))
var containerid = document.getElementById(containerid).innerHTML=page_request.responseText
}
My problem is that in FF the onClick function for <option> works, the pages are loaded correctly with AJAX in a <div>, but in IE does nothing. Do you know how to modify the script or the html, or both, to get it working in IE too ? Thanks very much!