I.E. Refresh problems
I have some problems with I.E.
I have an AJAX page which when a select box option is changed refreshes a search list. This works fine, I then added code to deal with back and refresh buttons so that on refresh the search is replayed. This involves setting the select options to those that they were before the refresh the running the code.
This works fine except that the display of the check box doesn't match the value it's been set to. In FireFox this is fine but in I.E. it doesn't refresh the values to the correct ones. It appears to hold the correct values but the list doesn't show this.
Here's the code which deals with the select boxes.
function handleManuHttpResponse() {
if (http.readyState == 4) {
if (http.responseText.indexOf('invalid') == -1) {
var indexID = 0;
var list = document.getElementById("make_F");
var xmlDocument = http.responseXML;
var items = xmlDocument.getElementsByTagName("manu");
clearList(list);
addElementToList(list, "-", "Select Manufacturer" );
if (items.length > 0)
{
for (var i=0; i<items.length; i++)
{
var node = items[i];
var manuid = node.getElementsByTagName("name")[0].firstChild.nodeValue;
var manuname = node.getElementsByTagName("name")[0].firstChild.nodeValue;
addElementToList(list, manuid, manuname);
if (manuname == getSessionValue("makeSearch")){
indexID = i+1;
}
}
} else {
alert("No Manufacturers found"); // This should never happen
}
document.getElementById("make_F").selectedIndex = indexID;
document.getElementById("make_F").value = getSessionValue("makeSearch");
}
}
}
The getSessionValue and addElementToList functions as they are functions I have created to return stored session values add elements to the select list.
Any ideas?
|