What I am trying to do is to change dynamically, the Background color of a
page by selecting a value in a set of options.
Ultimately the idea is to write that value to the registry, but first I want
to be able to dynamically change either the page BG color or the background
of the span ID="HexColorValue".
Below is what I cam up with and neddless to say does not work.
TIA
Philippe
<FORM NAME="frmMain" method="post">
<span ID="HexColorValue">Page Background Color:</span><br>
<SELECT ID="oHexColorValue" SIZE="1"
onchange="Javascript:fnChangeBackGroundColor(this.options[this.selectedIndex
].value)">
<OPTION VALUE="255,0,0">Red
<OPTION VALUE="0,255,0">Green
<OPTION VALUE="0,0,255">Blue
<OPTION VALUE="None" SELECTED>None
</SELECT>
<INPUT TYPE="button" Name="btCreatePalette" Value="Change It"
onClick="ChangePageBackGroundColor(HexColorValue_value)"></INPUT>
</FORM>
function fnChangeBackGroundColor(color)
{
alert(color);
document.all.HexColorValue.style.backgroundColor=document.all.oHexColorValue
.options[oHexColorValue.selectedIndex].value;
}
Brian Staff - 23 Apr 2004 18:04 GMT
Phillipe,
change your options to this:
<OPTION VALUE="#ff0000">Red
and your jscript to this:
document.all.HexColorValue.style.backgroundColor=document.all.oHexColorValue.op
tions[frmMain.oHexColorValue.selectedIndex].value;
Brian
poget - 26 Apr 2004 11:06 GMT
Thanks a lot Brian
Phil
> Phillipe,
>
[quoted text clipped - 3 lines]
>
> and your jscript to this:
document.all.HexColorValue.style.backgroundColor=document.all.oHexColorValue
.op
> tions[frmMain.oHexColorValue.selectedIndex].value;
>
> Brian