Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/06/2012, 10:10
Zipus
 
Fecha de Ingreso: junio-2010
Mensajes: 106
Antigüedad: 14 años, 8 meses
Puntos: 1
Error en Javascript

Cuando introduzo los datos detro de los inputs me devuelve esto en la consola de javascript "Uncaught TypeError: Cannot set property 'innerHTML' of null", pero no se a que se refiere con eso.

Quizas sea un error tonto, pero no veo nada extraño...

Código Javascript:
Ver original
  1. function calcular_maiz() {
  2.     var precio_maiz = document.maiz.precio_maiz.value;
  3.     var divisa_maiz = document.maiz.divisa_maiz.value;
  4.     var co_doll_maiz = (precio_maiz / 100) * 5000;
  5.     var fm_doll_maiz = co_doll_maiz / 127;
  6.     var co_euro_maiz = co_doll_maiz / divisa_maiz;
  7.     var fm_euro_maiz = co_euro_maiz / 127;
  8.     document.getElementById('co_doll_maiz').innerHTML = co_doll_maiz;
  9.     document.getElementById('fm_doll_maiz').innerHTML = fm_doll_maiz;
  10.     document.getElementById('co_euro_maiz').innerHTML = co_euro_maiz;
  11.     document.getElementById('fm_euro_maiz').innerHTML = fm_euro_maiz;
  12.   }

Código HTML:
Ver original
  1. <tr style="height:15.0pt;">
  2. <form name="maiz">
  3. <td class="excel5" style="height:15.0pt;">
  4.   <input type="text" value="" name="precio_maiz" style="width:60px;" onkeyup="calcular_maiz()">
  5. </td>
  6. <td class="excel5" align="right">
  7.   <input type="text" value="" name="divisa_maiz" style="width:60px;" onkeyup="calcular_maiz()">
  8. </td>
  9. </form>
  10. <td class="excel8">
  11.   <div id="co_doll_maiz"></div>
  12. </td>
  13. <td class="excel8">
  14.   <div id="tm_doll_maiz"></div>
  15. </td>
  16. <td class="excel8">
  17.   <div id="co_euro_maiz"></div>
  18. </td>
  19. <td class="excel8">
  20.   <div id="tm_euro_maiz"></div>
  21. </td>
  22. </tr>


Gracias xD