i am having this problem(but only with IE6, NS4.76 works)too, and when i click my ‘back’ link,
[code=php]
<a href = ‘java script:history.back();’>Change Order</a>
the second dropdown is not populated, there are no values to select other than the default.
When the page is originally submitted, a confirmation page is loaded. it is from here to the original order page where i lose the values in the dropdowns.
isn’t there a simple way to fix this? why wouldit work in Netscape 4.76 but not a more modern browser (IE 6)?
here’s the dropdowns:
FIRST DROPDOWN
[code=php]
<select name=”EventLocation” onChange=”fillSelectFromArray(this.form.PreferredRoom, ((this.selectedIndex == -1) ? null : team[this.selectedIndex-1]));”>
<option value=”eventloc”>Select a Location…</option>
<option>FirstOption</option>
<option>SecondOption</option>
</select>
SECOND DROPDOWN
[code=php]
<select name=”PreferredRoom”>
<option value=”Select a room…”,”VP”>Select a room…</option>
</select>
JAVASCRIPT THAT MAKES IT WORK
[code=php]
<!– Begin
team = new Array(
new Array(
new Array(“Select a room…”, “VP”),
new Array(“Post Parade”, “Post Parade”),
new Array(“Favourites”, “Favourites”),
new Array(“International Room”, “International Room”),
new Array(“International Room A”, “International Room A”),
new Array(“International Room B”, “International Room B”),
new Array(“Munnings Room”, “Munnings Room”),
new Array(“Dancer”, “Dancer”),
new Array(“Post Parade”, “Post Parade”),
new Array(“Trackside Tent”, “Trackside Tent”),
new Array(“Wood Club”, “Wood Club”)
),
new Array(
new Array(“Select a room…”, “VP”),
new Array(“Directors Lounge”, “Directors Lounge”),
new Array(“Sports Lounge”, “Sports Lounge”),
new Array(“Terrace Dining Room”, “Terrace Dining Room”),
new Array(“Trackside Lounge”, “Trackside Lounge”)
)
);
function fillSelectFromArray(selectCtrl, itemArray, goodPrompt, badPrompt, defaultItem) {
var i, j;
var prompt;
// empty existing items
for (i = selectCtrl.options.length; i >= 0; i–) {
selectCtrl.options[i] = null;
}
prompt = (itemArray != null) ? goodPrompt : badPrompt;
if (prompt == null) {
j = 0;
}
else {
selectCtrl.options[0] = new Option(prompt);
j = 1;
}
if (itemArray != null) {
// add new items
for (i = 0; i < itemArray.length; i++) {
selectCtrl.options[j] = new Option(itemArray[i][0]);
if (itemArray[i][1] != null) {
selectCtrl.options[j].value = itemArray[i][1];
}
j++;
}
// select first item (prompt) for sub list
selectCtrl.options[0].selected = true;
}
}
// End –>
Any help is greatly appreciated!!!
THANKS!!!