Bien no se que esta andando mal, o si todo anda mal que se yo. una manito? aqui les dejo el código.
Código:
function total(){ var PAG1 = document.getElementById("radiop1").value; var PAG2 = document.getElementById("radiop2").value; var PAG3 = document.getElementById("radiop3").value; var DIA1 = document.getElementById("radiod1").value; var DIA2 = document.getElementById("radiod2").value; var TOTAL1 = document.getElementById("total1").value; //alert("anda la funcion 2"); if(PAG1==checked && DIA1==checked){ TOTAL1 = 249; } else if(PAG2==checked && DIA1==checked){ TOTAL1 = 398; } else if(PAG3==checked && DIA2==checked){ TOTAL1 = 513; } }
Código HTML:
<input id="radiop1" type="radio" name="nroPag" value="1" class="radio" onclick=" total()"/> <input id="radiop2" type="radio" name="nroPag" value="2" class="radio" onclick=" total()"/> <input id="radiop3" type="radio" name="nroPag" value="3" class="radio" onclick=" total()"/> <input id="radiod1" type="radio" name="nroDia" value="1" class="radio" onclick=" total()"/> <input id="radiod2" type="radio" name="nroDia" value="2" class="radio" onclick=" total()"/> <p name="subtotalResumen">TOTAL: <input name="total1" id="total1" type="text" value="100"/></p>