avendo un totale in asp sotto forma <%=formatcurrency("totale,2")%> (es ? 3,00)vorrei sommarlo ai volori dei radiobutton, ma solo nel totale... è possibile?
come passo i valori asp nelle funzioni e renderlo compatibile con il totale javascript?
grazie
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<script type="text/javascript">
function valore(pagamento1)
{
document.forms[0].paga.value = pagamento1
ricalcola();
}
function valore2(pagamento2)
{
document.forms[0].paga2.value = pagamento2
ricalcola();
}
function ricalcola() {
p1 = isNaN(parseFloat(document.forms[0].paga.value)) ? 0 : parseFloat(document.forms[0].paga.value);
p2 = isNaN(parseFloat(document.forms[0].paga2.value)) ? 0 : parseFloat(document.forms[0].paga2.value)
document.forms[0].paga_tot.value = p1 + p2;
}
</script>
<form name="provaform" method="post" action="">
<table><tr><td valign="top" align="left" >Articolo2</td>
<td colspan="3" align="left">
<input type="radio" name="pagamento1" onclick="valore(this.value)" value="8.50">prova 8<br>
<input type="radio" name="pagamento1" onclick="valore(this.value)" value="0.00">prova 0,00<br>
</td>
<td align="right" >
<input type="text" name="paga" size="8" style="font-size: 10px; font-weight: bold; font-family: verdana; border: 0px solid #FF6600; color:#000000; background-color:#FF6600; right:auto" onFocus="this.blur()"><br>
</td>
</tr>
<tr>
<td valign="top" align="left" >Articolo1</td>
<td colspan="3" align="left">
<input type="radio" name="pagamento2" onclick="valore2(this.value)" value="5.00">prova5<br>
<input type="radio" name="pagamento2" onclick="valore2(this.value)" value="7.00">prova7<br>
</td>
<td align="right" >
<input type="text" name="paga2" onFocus="this.blur()" size="8" style="font-size: 10px; font-weight: bold; font-family: verdana; border: 0px solid #FF6600; color:#000000; background-color:#FF6600; right:auto" ><br>
</td></tr><tr><td colspan="4">Totale articolo</td><td align="right" >
<input type="text" name="paga_tot" onfocus="document.forms[0].paga2.value,document.forms[0].paga2.value" size="8" style="font-size: 10px; font-weight: bold; font-family: verdana; border: 0px solid #FF6600; color:#000000; background-color:#FF6600" ></td>
</tr></table>
</form>
</body>
</html>