S
sewerized
Hello all,
I'm having a problem with a user preferences form I'm creating. I want
to use dynamic dropdown SELECT boxes for this so my page doesn't get
cluttered with 100000 links.
Since I have 10000 Options embedded in the SELECT tags, I'm using an
External JS file to display them. I'm using these same Options for
different SELECT tags, so they can be "re-used (or looped)", instead of
writing them over and over again.
This is working PERFECTLY in Mozilla/Firefox 1.5 and Opera 9. The
dropdown boxes display exactly how I want, they render just the same as
they would in a normal embedded Options list. However, Internet
Explorer 5, 5.5 and 6.0 (and maybe also 7, haven't tested this) all
render the Options "outside" of the dropdown boxes, as plain text, so
they can't be clicked (and thus no value can be set). For some weird
reason IE CAN read embedded JS between SELECT tags, but not external???
Here's the example I'm using:
<form id="MyForm">
<select name='colorset'
onchange='addstyle(\"body\",this.options[this.selectedIndex].value,
this.id+\"_\"+this.selectedIndex);'>
<script type='text/javascript' src='colorjs.js'></script>
</select>
</form>
External .JS file:
document.write('<OPTION value=\"color:#ffffff\">White</OPTION>');
document.write('<OPTION value=\"color:#003366\">Darkblue</OPTION>');
The above example will NOT work in IE. It simply renders a blank
dropdown with the options outside of the dropdown box
However, the following example DOES work in IE, this time it's embedded
and NOT external.
<form id="MyForm">
<select name='colorset'
onchange='addstyle(\"body\",this.options[this.selectedIndex].value,
this.id+\"_\"+this.selectedIndex);'>
<script type='text/javascript'> document.write('<OPTION
value=\"color:#ffffff\">White</OPTION>'); document.write('<OPTION
value=\"color:#003366\">Darkblue</OPTION>') </script>
</select>
</form>
Is there any workaround for IE? I have like 100000 options, embedding
it normally would result in an at least 2mb JS file (which we don't
want, takes ages to load). I've already tried several other methods,
but to no avail.
Any help would be GREATLY appreciated...
I'm having a problem with a user preferences form I'm creating. I want
to use dynamic dropdown SELECT boxes for this so my page doesn't get
cluttered with 100000 links.
Since I have 10000 Options embedded in the SELECT tags, I'm using an
External JS file to display them. I'm using these same Options for
different SELECT tags, so they can be "re-used (or looped)", instead of
writing them over and over again.
This is working PERFECTLY in Mozilla/Firefox 1.5 and Opera 9. The
dropdown boxes display exactly how I want, they render just the same as
they would in a normal embedded Options list. However, Internet
Explorer 5, 5.5 and 6.0 (and maybe also 7, haven't tested this) all
render the Options "outside" of the dropdown boxes, as plain text, so
they can't be clicked (and thus no value can be set). For some weird
reason IE CAN read embedded JS between SELECT tags, but not external???
Here's the example I'm using:
<form id="MyForm">
<select name='colorset'
onchange='addstyle(\"body\",this.options[this.selectedIndex].value,
this.id+\"_\"+this.selectedIndex);'>
<script type='text/javascript' src='colorjs.js'></script>
</select>
</form>
External .JS file:
document.write('<OPTION value=\"color:#ffffff\">White</OPTION>');
document.write('<OPTION value=\"color:#003366\">Darkblue</OPTION>');
The above example will NOT work in IE. It simply renders a blank
dropdown with the options outside of the dropdown box
However, the following example DOES work in IE, this time it's embedded
and NOT external.
<form id="MyForm">
<select name='colorset'
onchange='addstyle(\"body\",this.options[this.selectedIndex].value,
this.id+\"_\"+this.selectedIndex);'>
<script type='text/javascript'> document.write('<OPTION
value=\"color:#ffffff\">White</OPTION>'); document.write('<OPTION
value=\"color:#003366\">Darkblue</OPTION>') </script>
</select>
</form>
Is there any workaround for IE? I have like 100000 options, embedding
it normally would result in an at least 2mb JS file (which we don't
want, takes ages to load). I've already tried several other methods,
but to no avail.
Any help would be GREATLY appreciated...