Tema: Select
Ver Mensaje Individual
  #3 (permalink)  
Antiguo 04/04/2011, 17:34
mogurbon
 
Fecha de Ingreso: enero-2011
Ubicación: DF
Mensajes: 898
Antigüedad: 14 años
Puntos: 155
Respuesta: Select

Código PHP:
Ver original
  1. <?php
  2. $servidor="http://".$_SERVER['SERVER_NAME'];
  3. $path=dirname($servidor.$_SERVER['PHP_SELF']);
  4. ?>
  5. <HTML>
  6. <HEAD>
  7.    <title>Suma</title>
  8.    <script language="javascript">
  9.    function Calcula(){
  10.        resultado=parseInt(document.formulario.a.options[document.formulario.a.selectedIndex].value) + parseInt(document.formulario.b.options[document.formulario.b.selectedIndex].value) +parseInt(document.formulario.c.options[document.formulario.c.selectedIndex].value);
  11.        
  12.        document.formulario.total.value=resultado;
  13.    }
  14.    </script>
  15. </HEAD>
  16. <BODY>
  17. <form action="" name="formulario" id="formulario" method="GET">
  18.  
  19. Edad:<br/>
  20. <select onchange="" name="a" >
  21.                 <option value="10"> 10&nbsp;| Sost&eacute;n de vida</option>
  22.                 <option value="9">&nbsp;9&nbsp; | Cuidados Intensivos y Quir&oacute;fano</option>
  23.                 <option value="8">&nbsp;8&nbsp; | Radioterapia</option>
  24.                 <option value="7">&nbsp;7&nbsp; | Monitoreo</option>
  25.                 <option value="6">&nbsp;6&nbsp; | Imagenolog&iacute;a</option>
  26.                 <option value="5">&nbsp;5&nbsp; | Laboratorio Cl&iacute;nico</option>
  27.                 <option value="4">&nbsp;4&nbsp; | Accesorios de Laboratorio</option>
  28.                 <option value="3">&nbsp;3&nbsp; | Computadoras</option>
  29.                 <option value="2">&nbsp;2&nbsp; | Accesorios de PC</option>
  30. </select>
  31.  
  32. <select name="b" onChange="">
  33.    <option value="5">&nbsp;5&nbsp; | Muerte</option>
  34.                 <option value="4">&nbsp;4&nbsp; | Daño al paciente y/o operador</option>
  35.                 <option value="3">&nbsp;3&nbsp; | Terapia inapropiada</option>
  36.                 <option value="2">&nbsp;2&nbsp; | ........</option>
  37.                 <option value="1">&nbsp;1&nbsp; | Sin riesgo significativo</option>
  38. </select>
  39.  
  40. <select name="c" onChange="">
  41.         <option value="5">&nbsp;5&nbsp; | Intensivo</option>
  42.         <option value="3">&nbsp;3&nbsp; | Medio</option>
  43.         <option value="1">&nbsp;1&nbsp; | M&iacute;nimo</option>
  44. </select>
  45.  
  46. <input type="text" readonly name="total">
  47. <input type="button" value="Calcular" onclick="Calcula();">
  48. </form>
  49.  
  50. </BODY>
  51. </HTML>