I’m trying to create a <form> where users will pick a color to use on some HTML content that I’m programmatically generating using PHP. To have a nice color picker, I used some popular JS code called ColorPicker by Matt Kruser ([url]http://www.mattkruse.com/javascript/colorpicker/
In his example on the page linked above, you see that after you pick the color, the hexadecimal code gets filled in the <input> area using the following code:
[CODE]<INPUT TYPE=”text” NAME=”color2″ SIZE=”20″ VALUE=””>
<A HREF=”#” onClick=”cp2.select(document.forms[0].color2,’pick2′);return false;” NAME=”pick2″ ID=”pick2″>Pick</A>
I would like it to work differently, but I don’t know JS, so I don’t know how to modify it. Here’s how I’d like it to work instead:
When a user clicks on “Pick” and selects the color, I’d like to have some text next to the color picker that says “Current Color.” And that text should have the color that the user chose.
Some thing like the following (which will obviously not work, I’m just trying to illustrate):
[CODE]
<LABEL name=”color2″ style=”color: user_selected_color; font-weight: bold;”>Current Color</LABEL>
<A HREF=”#” onClick=”cp2.select(document.forms[0].color2,’pick2′);return false;” NAME=”pick2″ ID=”pick2″>Pick</A>
Anyone know how to do that?
Thanks a lot,