Jeg har lavet det sådan her - og selve farvevalget virker fint nok, men den gider ikke sætte value i det tekst-felt, jeg har lavet længere nede. LiveDisplay skal du ikke tage dig af - det er et andet script jeg har kørende andetsteds fra.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="
http://www.w3.org/1999/xhtml"><html>
<head>
<link href="colorjack.css" rel="stylesheet" type="text/css" />
<title></title>
<script src="js/colorjack.js" type="text/JavaScript"></script>
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="sms_title">
<tr>
<td align="center"><div id="plugin" style="TOP: 0px; LEFT: 0px; Z-INDEX: 20;">
<div id="plugHEX" onmousedown="stop=0; setTimeout('stop=1',100);">FFFFFF</div><div id="plugCLOSE" onmousedown="toggle('plugin')">X</div><br>
<div id="SV" onmousedown="HSVslide('SVslide','plugin',event)" title="Saturation + Value">
<div id="SVslide" style="TOP: -4px; LEFT: -4px;"><br /></div>
</div>
<div id="H" onmousedown="HSVslide('Hslide','plugin',event)" title="Hue">
<div id="Hslide" style="TOP: -7px; LEFT: -8px;"><br /></div>
<div id="Hmodel"></div>
</div>
</div>
<br>
<!--Sample DIV to show selected color -->
<table height="16" cellspacing="0" cellpadding="0" border="0" id="colorbox" style="width: 200px; border: 1px solid #77ADD9; background-color: #ffffff" class="calendartext">
<tr>
<td width="160" valign="top">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="center" width="14" height="12" valign="top"><img src="images/transparent.gif" width="1" height="2" alt=""><br><img src="images/transparent.gif" alt="" border="0" id="ikon"></td>
<td class="calendartext" style="padding-left: 5px; padding-right: 5px;" valign="top"><b><div id="LiveDisplay" align="left"></div></b></td>
</tr>
</table>
</td>
</tr>
</table>
<input type="text" id="colorch">
<script type="text/javascript">
//*** CUSTOMIZE mkcolor() function below to perform the desired action when the color picker is being dragged/ used
//*** Parameter "v" contains the latest color being selected
function mkColor(v){
//** In this case, just update DIV with ID="colorbox" so its background color reflects the chosen color
$S('colorbox').background='#'+v;
$S('colorch').value='#'+v;
}
loadSV(); updateH('FFFFFF');
</script>
</td>
</tr>
</table>
</body>
</html>