ciao,ho un problema di passaggio valori dal form a una funzione js che dovrebbe stampare i valori in una textarea senza sovrascrivere. grazie anticipatamente,vi posto il codice :
(in particolare la funz add dovrebbe accettare il valore di ogni singolo select e scriverlo sulla textarea)
<script type="text/javascript">
function add(var value){
document.ordine.GetElementById('text').value=value ;
}
function controlla(){
if(document.ordine.codCliente.value==""){
alert("Inserire codice Cliente");
return(false);}
}
</script>
</head>
<body>
<h4>GESTIONE ORDINI</h4>
<form name="ordine" action="mailordine.php" method="post" onsubmit="return controlla()">
<table style="text-align: left; width: 549px; height: 140px;" border="1" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td>
BOX DOCCE
<select name="box" id="box">
<option value="noBox">... </option>
<option value="white1"> WHITE1</option>
<option velue="white2"> WHITE2</option>
<option value="white3"> WHITE3</option>
<option value="white4"> WHITE4</option>
<option value="silver1"> SILVER1</option>
<option value="silver2"> SILVER2</option>
<option value="silver3"> SILVER3</option>
<option value="silver4"> SILVER4</option>
<option value="silver5"> SILVER5</option>
<option value="silver6"> SILVER6</option>
</select>
<input type="button" value="add" onclick="add('document.GetElementById('box').value ')"
>
COLORE
<select name="coloreDoccia" id="coloreDoccia">
<option value="noCol">... </option>
<option value="bianco">BIANCO</option>
<option velue="silver"> SILVER</option>
<option value="pergamon">PERGAMON</option>
<option value="bianco&cromo">BIANCO&CROMO</option>
</select>
<input type="button" value="add"id="button2" onclick="add('document.GetElementById('coloreDocci a').value')"
>
> </td>
<td>
COLONNE ATTREZZATE
<select name="colonna" id="colonna">
<option value="noColonna">... </option>
<option value="prestige1">PRESTIGE1</option>
<option velue="prestige2"> PRESTIGE2</option>
<option value="prestige3">PRESTIGE3</option>
<option value="prestige4">PRESTIGE4</option>
</select>
<input type="button" value="add"id="button3" onclick="add('document.GetElementById('colonna').v alue')"
>
COLORE
<select name="colCol" id="colCol">
<option value="noCol">... </option>
<option value="colCol1">Colore1</option>
<option velue="colCol2"> Colore2</option>
<option value="colCol3">Colore3</option>
<option value="colCol4">Colore4</option>
<option value="colCol5">Colore5</option>
<option value="colCol6">Colore6</option>
<option value="colCol7">Colore7</option>
<option value="colCol8">Colore</option>
</select>
<input type="button" value="add"id="button4" onclick="add('document.GetElementById('colCol').va lue')"
>
<td rowspan="4" width="434">
<h4>RIEPILOGO<h4>
<textarea id="text" name ="textarea" READONLY="READONLY" cols="20" rows="20"></textarea>
</tr>
<tr>
<td>
PANNELLI DOCCIA
<select name="pannelli" id="pannelli">
<option value="noPan">... </option>
<option value="Kayak1000">Kayak1000</option>
<option velue="Kayak1700"> Kayak1700</option>
<option value="Kayak1600">Kayak1600</option>
<option value="Kayak1800">Kayak1800</option>
<option value="Seggiolino1">Seggiolino1</option>
<option value="Seggiolino2">Seggiolino2</option>
<option value="Seggiolino3">Seggiolino3</option>
<option value="Seggiolino4">Seggiolino4</option>
</select>
<input type="button" value="add"id="button5" onclick="add('document.GetElementById('pannelli'). value')"
>
</td>
<td>
ACCESSORI(cod.)
<select name="accessori" id="accessori">
<option value="noAcc">... </option>
<option value="A001">A001</option>
<option velue="A002"> A002</option>
<option value="A003">A003</option>
<option value="A004">A004</option>
<option value="A005">A005</option>
<option value="A006">A006</option>
<option value="A007">A007</option>
<option value="A008">A008</option>
<option value="A009">A009</option>
<option value="A010">A010</option>
<option value="A011">A011</option>
<option value="A012">A012</option>
<option value="A013">A013</option>
<option value="A014">A014</option>
<option value="A015">A015</option>
<option value="A016">A016</option>
<option value="A017">A017</option>
<option value="A018">A018</option>
<option value="A019">A019</option>
<option value="A020">A020</option>
<option value="A021">A021</option>
<option value="A022">A022</option>
</select>
<input type="button" value="add" id="button6" onclick="add('document.GetElementById('accessori') .value')"
>
> </td>
</tr>
<tr>
<td>
SOFFIONI
<select name="soffioni" id="soffioni">
<option value="noSoff">... </option>
<option value="S001">S001</option>
<option velue="S002"> S002</option>
<option value="S003">S003</option>
<option value="S004">S004</option>
<option value="S005">S005</option>
<option value="S006">S006</option>
<option value="S007">S007</option>
<option value="S008">S008</option>
<option value="S009">S009</option>
<option value="S010">S010</option>
<option value="S011">S011</option>
<option value="S012">S012</option>
<option value="S013">S013</option>
<option value="S014">S014</option>
<option value="S015">S015</option>
<option value="S016">S016</option>
<option value="S017">S017</option>
<option value="S018">S018</option>
<option value="S019">S019</option>
<option value="S020">S020</option>
<option value="S021">S021</option>
<option value="S022">S022</option>
<option value="S023">S023</option>
</select>
<input type="button" value="add"id="button7" onclick="add('document.GetElementById('soffioni'). value')"
>
> </td>
<td>
FLESSIBILI
<select name="flessibili" id="flessibili">
<option value="noFless">... </option>
<option value="F001">F001</option>
<option velue="F002"> F002</option>
<option value="F003">F003</option>
<option value="F004">F004</option>
<option value="F005">F005</option>
<option value="F006">F006</option>
<option value="F007">F007</option>
</select>
<input type="button" value="add"id="button8" onclick="add('document.GetElementById('flessibili' ).value')"
>
</tr>
<tr>
<td>
DOCCE
<select name="docce" id="docce">
<option value="noDoc">... </option>
<option value="D001">D001</option>
<option velue="D002"> D002</option>
<option value="D003">D003</option>
<option value="D004">D004</option>
<option value="D005">D005</option>
<option value="D006">D006</option>
<option value="D007">D007</option>
<option value="D008">D008</option>
<option value="D009">D009</option>
<option value="D010">D010</option>
<option value="D011">D011</option>
<option value="D012">D012</option>
<option value="D013">D013</option>
<option value="D014">D014</option>
<option value="D015">D015</option>
<option value="D016">D016</option>
<option value="D017">D017</option>
<option value="D018">D018</option>
<option value="D019">D019</option>
<option value="D020">D020</option>
<option value="D021">D021</option>
</select>
<input type="button" value="add"id="button9" onclick="add('document.GetElementById('docce').val ue')"
>
> </td>
<td>
<h2>CODICE CLIENTE <input name="codCliente" lenght="10" maxlenght="20" type="text"></h2>
</td>
</tr>
</tbody>
</table>
<input value="INVIA ORDINE" type="submit"><input value="Azzera" type="reset"></form>
</body>
</html>