Guest_imported
New member
- Jan 1, 1970
- 0
<HTML>
<HEAD>
<TITLE>A Simple Color Picker</TITLE>
<SCRIPT language="JavaScript">
<!--Hide from older browsers
//Stop hiding--->
browserName=navigator.appName;
if(browserName=="Netscape" {
alert("Netscape users can change only the background color"
}
function ApplyColor() {
var BCR = (document.CP.BackRed.VALUE);
var BCG = (document.CP.BackGreen.VALUE);
var BCB = (document.CP.BackBlue.VALUE);
var TCR = (document.CP.TextRed.VALUE);
var TCG = (document.CP.TextGreen.VALUE);
var TCB = (document.CP.TextBlue.VALUE);
var BackColor= "#" + BCR + BCG + BCB;
var TextColor= "#" + TCR + TCG + TCB;
document.bgColor = "BackColor";
document.fgColor = "TextColor";
}
</SCRIPT>
</HEAD>
<BODY onLoad="test_browser"(); onLoad="StartForm"();>
<H1 ALIGN=CENTER>A Simple Color Picker</H1>
<FORM NAME=CP>
<TABLE BORDER CELLPADDING=5>
<TR>
<TD WIDTH=320 VALIGN=TOP>
<TABLE>
<TR>
<TD COLSPAN=3>Background (enter values from '00' to 'FF')</TD>
</TR>
<TR>
<TD>RED: <INPUT NAME=BackRed VALUE="FF" SIZE=2</TD>
<TD>GREEN: <INPUT NAME=BackGreen VALUE="FF" SIZE=2 ></TD>
<TD>BLUE: <INPUT NAME=BackBlue VALUE="FF" SIZE=2></TD>
</TR>
<TR>
<TD COLSPAN=3>Text (enter values from '00' to 'FF')</TD>
</TR>
<TR>
<TD>RED: <INPUT NAME=TextRed VALUE="00" SIZE=2></TD>
<TD>GREEN: <INPUT NAME=TextGreen VALUE="00" SIZE=2></TD>
<TD>BLUE: <INPUT NAME=TextBlue VALUE="00" SIZE=2></TD>
</TR>
<TR>
<TD COLSPAN=3 ALIGN=CENTER>
<INPUT TYPE=BUTTON VALUE="Apply" onClick="ApplyColor();">
<INPUT TYPE=BUTTON VALUE="Reload" onClick="location.reload();">
</TD>
</TR>
</TABLE>
</TD>
<TD WIDTH=300 VALIGN=TOP>
<B>HAMLET:</B>
<P>Speak the speech, I pray you, as I pronounced it to you, trippingly on
the tongue: but if you mouth it, as many of your players do, I had as lief
the town-crier spoke my lines. </P>
</TD>
</TR>
</TABLE>
</FORM>
<SUP>*</SUP>If you are using Netscape, you won't be able to change the
text color.
</BODY>
</HTML>
Here is my code i am suppose to be able to change background and textcolors can change the colors once. can anyone help
<HEAD>
<TITLE>A Simple Color Picker</TITLE>
<SCRIPT language="JavaScript">
<!--Hide from older browsers
//Stop hiding--->
browserName=navigator.appName;
if(browserName=="Netscape" {
alert("Netscape users can change only the background color"
}
function ApplyColor() {
var BCR = (document.CP.BackRed.VALUE);
var BCG = (document.CP.BackGreen.VALUE);
var BCB = (document.CP.BackBlue.VALUE);
var TCR = (document.CP.TextRed.VALUE);
var TCG = (document.CP.TextGreen.VALUE);
var TCB = (document.CP.TextBlue.VALUE);
var BackColor= "#" + BCR + BCG + BCB;
var TextColor= "#" + TCR + TCG + TCB;
document.bgColor = "BackColor";
document.fgColor = "TextColor";
}
</SCRIPT>
</HEAD>
<BODY onLoad="test_browser"(); onLoad="StartForm"();>
<H1 ALIGN=CENTER>A Simple Color Picker</H1>
<FORM NAME=CP>
<TABLE BORDER CELLPADDING=5>
<TR>
<TD WIDTH=320 VALIGN=TOP>
<TABLE>
<TR>
<TD COLSPAN=3>Background (enter values from '00' to 'FF')</TD>
</TR>
<TR>
<TD>RED: <INPUT NAME=BackRed VALUE="FF" SIZE=2</TD>
<TD>GREEN: <INPUT NAME=BackGreen VALUE="FF" SIZE=2 ></TD>
<TD>BLUE: <INPUT NAME=BackBlue VALUE="FF" SIZE=2></TD>
</TR>
<TR>
<TD COLSPAN=3>Text (enter values from '00' to 'FF')</TD>
</TR>
<TR>
<TD>RED: <INPUT NAME=TextRed VALUE="00" SIZE=2></TD>
<TD>GREEN: <INPUT NAME=TextGreen VALUE="00" SIZE=2></TD>
<TD>BLUE: <INPUT NAME=TextBlue VALUE="00" SIZE=2></TD>
</TR>
<TR>
<TD COLSPAN=3 ALIGN=CENTER>
<INPUT TYPE=BUTTON VALUE="Apply" onClick="ApplyColor();">
<INPUT TYPE=BUTTON VALUE="Reload" onClick="location.reload();">
</TD>
</TR>
</TABLE>
</TD>
<TD WIDTH=300 VALIGN=TOP>
<B>HAMLET:</B>
<P>Speak the speech, I pray you, as I pronounced it to you, trippingly on
the tongue: but if you mouth it, as many of your players do, I had as lief
the town-crier spoke my lines. </P>
</TD>
</TR>
</TABLE>
</FORM>
<SUP>*</SUP>If you are using Netscape, you won't be able to change the
text color.
</BODY>
</HTML>
Here is my code i am suppose to be able to change background and textcolors can change the colors once. can anyone help