ho fatto il seguente script ed ho bisogno che il click di una cella cambi lo fondo del textbox, potreste aiutarmi?
Potete scaricare il codice ed eseguirlo per capire meglio.
Quando premo sulla cella rossa lo sfondo del textbox deve colorarsi di rosso!
codice:
<html>
<head>
<title>Prova</title>
<script language="javascript">
function color(HEX)
{
document.picker.color.value=HEX
document.picker.color.background='#111111';
}
</script>
</head>
<body>
<table border=1 cellpadding=0 cellspacing=0>
<tr>
<td bgColor="#330000" width="15" height="15" onCLick="color('#330000')"></td>
<td bgColor="#333300" width="15" height="15" onCLick="color('#333300')"></td>
<td bgColor="#336600" width="15" height="15" onCLick="color('#336600')"></td>
<td bgColor="#339900" width="15" height="15" onCLick="color('#339900')"></td>
<td bgColor="#33CC00" width="15" height="15" onCLick="color('#33CC00')"></td>
<td bgColor="#33FF00" width="15" height="15" onCLick="color('#33FF00')"></td>
<td bgColor="#66FF00" width="15" height="15" onCLick="color('#66FF00')"></td>
<td bgColor="#66CC00" width="15" height="15" onCLick="color('#66CC00')"></td>
<td bgColor="#669900" width="15" height="15" onCLick="color('#669900')"></td>
<td bgColor="#666600" width="15" height="15" onCLick="color('#666600')"></td>
<td bgColor="#663300" width="15" height="15" onCLick="color('#663300')"></td>
<td bgColor="#660000" width="15" height="15" onCLick="color('#660000')"></td>
<td bgColor="#FF0000" width="15" height="15" onCLick="color('#FF0000')"></td>
<td bgColor="#FF3300" width="15" height="15" onCLick="color('#FF3300')"></td>
<td bgColor="#FF6600" width="15" height="15" onCLick="color('#FF6600')"></td>
<td bgColor="#FF9900" width="15" height="15" onCLick="color('#FF9900')"></td>
<td bgColor="#FFCC00" width="15" height="15" onCLick="color('#FFCC00')"></td>
<td bgColor="#FFFF00" width="15" height="15" onCLick="color('#FFFF00')"></td>
</tr></table>
<form name="picker" id="picker">
HEX Number: <input type="text" name="color" id="picker">
</form>
</body>
</html>
Grazie
Luca