I want the selected option in the un-dropped view of the box to be dynamically changed to the same color as the background color of the selected option. That make sense? here is the code, the expression() part is the only part that seems to fail oddly.
<select name="surveyColor" style="background-color: expression(surveyColor.options[surveyColor.selectedIndex].value);"> <option value="lightBlue" style="background-color: lightblue;">Blue</option> <option value="pink" style="background-color: pink;">Pink</option> <option value="lightGreen" style="background-color: lightgreen;">Green</option> <option value="yellow" style="background-color: yellow;">Yellow</option> </select>
any insights would be great! thx ^_^
//bbcode added --gary/kk5st/mod
The expression() value is an
The expression() value is an IE proprietary value, and not generally supported. As used, I would guess that when the javascript expression is read, the value is not yet defined. It should throw an error.
I don't have any debugging tools for IE, and Firefox would properly ignore it. So, I can't help further.
cheers,
gary
ah yes, thank you. I was
ah yes, thank you. I was just testing in FireFox so that explains it. The expression placed in javascript works perfectly but placed as an expression in CSS it only works in IE and not firefox.
So there is no other way to create dynamic CSS?
thx
Attach an onchange event
Attach an onchange event handler to select?
cheers,
gary