Código HTML:
<html> <head> <title>Calculador de productos</title> <script> function cambia1(form1){ if(document.form1.dis[0].selected == true){ document.form1.cos_dis.value="0"; } if(document.form1.dis[1].selected == true){ document.form1.cos_dis.value="5"; } if(document.form1.dis[2].selected == true){ document.form1.cos_dis.value="10"; } } function cambia2(form1){ if(document.form1.pap[0].selected == true){ document.form1.cos_pap.value="0"; } if(document.form1.pap[1].selected == true){ document.form1.cos_pap.value="2"; } if(document.form1.pap[2].selected == true){ document.form1.cos_pap.value="7"; } if(document.form1.pap[3].selected == true){ document.form1.cos_pap.value="2"; } } </script> </head> <body><form id="form1" name="form1" method="post" action=""> <table width="501" border="2"> <tr> <th width="126" rowspan="2" scope="col"> </th> <th width="131" scope="col">Discos</th> <th width="120" scope="col">Papelería</th> </tr> <tr> <td><center> <select name="dis" id="dis" onchange="cambia1()"> <option value="0">Ninguno</option> <option value="5">CD</option> <option value="10">DVD</option> </select></center></td> <td><center> <select name="pap" id="pap"onchange="cambia2()"> <option value="0">Ninguno</option> <option value="2">Lápiz</option> <option value="7">Pluma</option> <option value="2">Borrador</option> </select> </center></td> <td width="94"><div align="center"><strong>Total:</strong></div></td> </tr> <tr> <td height="26"><strong>Costo:</strong></td> <td> $ <input name="cos_dis" type="text" disabled="disabled" id="cos_dis" value="0" size="3" /> </td> <td> $ <input name="cos_pap" type="text" disabled="disabled" id="cos_pap" value="0" size="3" /> </td> <td> $ <input name="total_cos" type="text" disabled="disabled" id="total_cos" value="0" size="5" /> </td> </tr> </table></form> </body> </html>
Pienso que con javascript lo puedo lograr, pero busco ayuda haver si me dicen por donde comenzar