Ver Mensaje Individual
  #5 (permalink)  
Antiguo 09/05/2014, 02:20
Pakonan
 
Fecha de Ingreso: mayo-2014
Mensajes: 30
Antigüedad: 10 años
Puntos: 0
Respuesta: Formulario que calcule valores sin pulsar boton

Si si que lo he puesto.. y he estado mirando información sobre Jquery y como hacer esto pero no consigo que me lo haga como yo creo y creo que principalmente el problema es que uno de los valores que cojo proviene de un select.

La funcion que hice ahora es así, y tampoco me funciona

Código Javascript:
Ver original
  1. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
  2. <script>
  3. $('input').keyup(function(){ // run anytime the value changes
  4.    
  5.    
  6.     var firstValue=parseFloat($('#precio_notax').val()); // get value of field
  7.     var secondValue=parseFloat($('#tax').val()); // convert it to a float
  8.     var secondValue=secondValue/100;
  9.     $('#pvp').html(firstValue + firstValue*secondValue); // add them and output it
  10. });
  11. </script>