Código Javascript:
Ver original
<script type='text/javascript' src='jquery.min.js'></script> <script type="text/javascript"> $(function(){ $('#cantidad, #precio').change(function(){ var cantidad = parseFloat($('#cantidad').val()); var precio = parseFloat($('#precio').val()); var total = precio*cantidad; $('#valor').val(total); }); }); </script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Documento sin título</title> <script language="JavaScript"> function cambiar() { var index=document.forms.formulario.descripcion.selectedIndex; formulario.precio.length=0; if(index==0) superplusanual(); if(index==1) superplussemestral(); if(index==2) superplustrimestral(); if(index==3) superplusmensual(); if(index==4) plusanual(); if(index==5) plussemestral(); if(index==6) plustrimestral(); if(index==7) plusmensual(); if(index==8) basicoanual(); if(index==9) basicosemestral(); } </script> <script language="JavaScript"> function superplusanual(){ opcion0=new Option("6200","6200","defauldSelected"); document.forms.formulario.precio.options[0]=opcion0; } function superplussemestral(){ opcion0=new Option("7500","7500","defauldSelected"); document.forms.formulario.precio.options[0]=opcion0; } function superplustrimestral(){ opcion0=new Option("14000","14000","defauldSelected"); document.forms.formulario.precio.options[0]=opcion0; } function superplusmensual(){ opcion0=new Option("16000","16000","defauldSelected"); document.forms.formulario.precio.options[0]=opcion0; } function plusanual(){ opcion0=new Option("8500","8500","defauldSelected"); document.forms.formulario.precio.options[0]=opcion0; } function plussemestral(){ opcion0=new Option("45000","45000","defauldSelected"); document.forms.formulario.precio.options[0]=opcion0; } function plustrimestral(){ opcion0=new Option("6500","6500","defauldSelected"); document.forms.formulario.precio.options[0]=opcion0; } function plusmensual(){ opcion0=new Option("7500","7500","defauldSelected"); document.forms.formulario.precio.options[0]=opcion0; } function basicoanual(){ opcion0=new Option("17000","17000","defauldSelected"); document.forms.formulario.precio.options[0]=opcion0; } function basicosemestral(){ opcion0=new Option("21600","21600","defauldSelected"); document.forms.formulario.precio.options[0]=opcion0; } </script>