Originariamente inviato da Mich_
I nomi dei checkbox devono proprio essere uguali e contenere la quadra?
Comunque ecco una soluzione possibile:
<input type="checkbox" name="scelte[]" value="valore 1" onclick="aggiungi(this,1);">valore 1
<input type="checkbox" name="scelte[]" value="valore 2" onclick="aggiungi(this,2);">valore 2
<input type="checkbox" name="scelte[]" value="valore 3" onclick="aggiungi(this,3);">valore 3
<textarea name="note" cols="30" rows="6">
</textarea>
Nella head corrispondente devi mettere lo script:
function aggiungi(ff,pp) {
var str;
switch (pp) {
case 1:
str = "testo preimpostato uno";
break;
case 2:
str = "testo preimpostato due";
break;
case 3:
str = "testo preimpostato tre";
break;
}
ff.form.note.value += str;
}
Nota: il testo verra` aggiunto in coda alla textarea (non e` possibile altrimenti.
Ciao
Michele