Recientemente he descubierto que puedo sumar los CheckBox ahora solo me falta poder hacer lo mismo con las listas despegables,como seria posible?
Aqui dejo el codigo retocado,con la suma total de los checkbox.
Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin título</title>
<script language="JavaScript" type="text/JavaScript">
function suma(obj){
total=parseInt(document.getElementById("precio").value.replace(",",""));
if(obj.checked){
total+=parseInt(obj.value);
}else{
total-=parseInt(obj.value);
}
txttotal=total+"";
if (txttotal=="0") txttotal="000";
document.getElementById("precio").value=txttotal.substring(0,txttotal.length-2)+","+txttotal.substring(txttotal.length-2);
}
</script>
</head>
<body>
<FORM>
<TABLE BORDER="0" ALIGN="center">
<TR>
<TD WIDTH="213">Slots:</TD>
<TD WIDTH="487"><SELECT NAME="configuracion[1]">
<OPTION VALUE="1" SELECTED>11 Slots = 10.00€
<OPTION VALUE="2">12 Slots = 10.50€
<OPTION VALUE="3">13 Slots = 11.00€
<OPTION VALUE="4">14 Slots = 11.50€
<OPTION VALUE="5">15 Slots = 12.00€
<OPTION VALUE="6">16 Slots = 12.50€
<OPTION VALUE="7">17 Slots = 13.00€
<OPTION VALUE="8">18 Slots = 13.50€
<OPTION VALUE="9">19 Slots = 14.00€
<OPTION VALUE="10">20 Slots = 14.50€
<OPTION VALUE="11">21 Slots = 15.00€
<OPTION VALUE="12">22 Slots = 15.50€
<OPTION VALUE="13">23 Slots = 16.00€
<OPTION VALUE="14">24 Slots = 16.50€
<OPTION VALUE="15">25 Slots = 17.00€
<OPTION VALUE="16">26 Slots = 17.50€
<OPTION VALUE="17">27 Slots = 18.00€
<OPTION VALUE="18">28 Slots = 18.50€
<OPTION VALUE="19">29 Slots = 19.00€
<OPTION VALUE="20">30 Slots = 19.50€
<OPTION VALUE="21">31 Slots = 20.00€
<OPTION VALUE="22">32 Slots = 20.50€
</SELECT></TD>
<TR>
<TD WIDTH="213">FPS de Servidor:</TD>
<TD WIDTH="487"><select name="configuracion[2]">
<option value="23" selected="selected" >500 Fps + 0€</option>
<option value="24" onChange="suma(this)">1000 Fps + €5.00EUR</option>
</select></TD>
<TR>
<TD WIDTH="213">Servidor Publico :</TD>
<TD WIDTH="487"><input type="checkbox" name="configuracion[3]" value="500" onChange="suma(this)"> Sí + 5.00€</TD>
<TR>
<TD WIDTH="213">Quitar publicidad del servidor:</TD>
<TD WIDTH="487"><input type="checkbox" name="configuracion[4]" value="500" onChange="suma(this)"> Sí + 5.00€</TD>
<TR>
<TD WIDTH="213"></TD>
<TD WIDTH="487"></TD>
<TR>
<TD WIDTH="213">Fastdowload:</TD>
<TD WIDTH="487"><input type="checkbox" name="configuracion[5]" value="500" onChange="suma(this)"> Sí + 5.00€</TD>
</TABLE>
<TABLE width="660" BORDER="0" ALIGN="center">
<TR>
<TD WIDTH="87">
Precio Total
<td width="282"><input type="text" name="precio" id="precio" value="0,00" /></td>
<td width="137"></TD>
</TABLE>
<TABLE width="660" BORDER="0" ALIGN="center">
<TR>
<TD WIDTH="213">
<INPUT TYPE="submit" VALUE="Enviar Configuracion">
<INPUT TYPE="reset" VALUE="Borrar Configuracion">
</TD>
</TABLE>
</FORM>
</body>
</html>
Dejo donde tengo subido el ejemplo: http://www.santacremasteam.com/xeyko/cart/configcs2.html