Ver Mensaje Individual
  #7 (permalink)  
Antiguo 13/02/2013, 18:43
Avatar de freesoftwarrior
freesoftwarrior
 
Fecha de Ingreso: marzo-2006
Mensajes: 362
Antigüedad: 18 años, 1 mes
Puntos: 10
Respuesta: Problema con eventos en la creación de inputs dinámicos

Me disculpo por la demora en responder, pero tuve algunos problemas familiares.
El código final es este:

Cita:
icremento =0;
function crear(obj)
{
icremento++;

field = document.getElementById('field');
contenedor = document.createElement('div');
contenedor.id = 'div'+icremento;
field.appendChild(contenedor);

boton = document.createElement('input');
boton.type = 'text';
boton.name = 'peso'+icremento;
boton.id = 'peso'+icremento;
boton.size = 10;
boton.style.border = "1px solid white";
boton.style.background = "#4F6497";
boton.style.color = "white";
boton.style.font = "x-small Arial";
boton.onfocus = function () {estilo(this.id,1)}
boton.onblur = function () {estilo(this.id,2)}

boton.onchange = function () {formato(this.value,'dec',this.id)}
boton.onkeypress = function () {return acceptNum2(event,this.id)}
contenedor.appendChild(boton);
}
Lamentablemente las funciones para los eventos onfocus y onblur siguen sin funcionar, más el resto de funciones si funcionan perfectamente bien. Creo que tiro la toalla jejejeje