aspetta... ti faccio un attimo vedere la funzione completa:
Codice PHP:
<html>
<head>
<script language="JavaScript">
function somma(v,s) {
var f=document.nomeform;
var realvalue=(f.c.value=="")?0:parseInt(f.c.value);
var valore;
if (s)
valore = realvalue+parseInt(v);
else
valore = realvalue-parseInt(v);
f.c.value = valore;
f.nuovocampo.value = valore * 1.20;
f.percentuale.value = valore * 0.20;
}
function funzione_1(f) {
f.funz1.value = f.nuovocampo.value;
}
function funzione_2(f) {
f.funz2.value = f.nuovocampo.value * 0.95;
document.paypal.amount.value = f.funz2.value;
}
</script>
</head>
<body>
<form name="nomeform" onsubmit="validaform(this);return false">
prodotto 79 <input type="checkbox" value="79" onclick="somma(this.value, this.checked);" name="valore 79"/>
prodotto 100 <input type="checkbox" value="79" onclick="somma(this.value, this.checked);" name="valore 100"/>
prodotto 200 <input type="checkbox" value="79" onclick="somma(this.value, this.checked);" name="valore 200"/>
TOTALE NETTO <input type="text" name="c" value="0"/ disabled size="4">
IVA (20%) <input name="percentuale" type="text"/ disabled value="0" size="4">
TOTALE LORDO <input name="nuovocampo" type="text"/ disabled value="0" size="4">
valore normale
<input type="radio" onclick="funzione_1(this.form)"/>
<input name="funz1" type="text"/ disabled value="0" size="4">
valore scontato
<input type="radio" onclick="funzione_2(this.form)"/>
<input name="funz2" type="text" value="0" size="4"></form>