G’Day,
I’ve been writing some fairly basic JavaScripts revolving around selections from a combo box. They work perfectly fine for me (using Firefox), but others have told me they had some problems.
One of those problems is with a combo box which changes the contents of another combo box. The steps are to set the length to 1 (ie only leave the default option that is used by all) and add x new options. An example is below:
[code=php]<!–
function updateSelection(FormData)
{
var selection = FormData.recipes.value;
if (selection == “gustRec”)
{
FormData.name.value = “gustRec”;
FormData.step.length = “1”;
FormData.step.options[1] = new Option(“gustRec_1”, “gustRec_1”);
FormData.step.options[2] = new Option(“gustRec_2”, “gustRec_2”);
FormData.step.options[3] = new Option(“gustRec_3”, “gustRec_3”);
FormData.oper.value = “No Step”;
FormData.conf.value = “None Selected”;
FormData.pipe.value = “”;
FormData.size.value = “”;
FormData.snum.value = “0”;
FormData.dels.checked = false;
FormData.delr.checked = false;
}
}
// –>
On my system, this works fine, however a Mac user told me that if they, say, select one with seven options followed by another with three, then they get the three new options, followed by the last four of the old ones. I saw the same effect when I took out the `FormData.step.length = “1”;’ line, so I am assuming that this line is not compatable for some reason.
My second problem is that, apparently, none of the combo boxes ever change anything for Internet Explorer users. The code is basically the same for all the functions (including the example above), but most of them only change the value of a few text boxes. Is there some oddity with IE whereby it cannot use a script like the one above?
Thanks for any advice!