Hola amigos
Tengo una funcion que la llamo desde un evento de un objeto html, le paso como parametro a la funcion un indice y 3 id's de objetos como lo muestro en la funcion:
Código:
function funcion(key, idObj1, idObj2, idObj3)
{
//Objetos
var div = document.getElementById(idObj1); //Div donde se mostrara los resultados
var txt = objTxt; //document.getElementById("txtB"); //Caja de Texto de la Busqueda
var cmb = document.getElementById(strCmb); //DropDownList
//Declaración de Arrays
.....
Codigo
......
strHtml = "<table border = '1'><tr><td><table ><tr><td><table >";
for(x=0; x<arrItems.length; x++)
strHtml += "<tr><td id = '" + arrItems[x][0] + "' onmouseover='CambioEstilo(this,1);' onmouseout='CambioEstilo(this, 2);' onclick='Selecciona(this.id, \"" + div.id + " \" , \"" + cmb.id + " \", \"" + txt.id + " \" );' >" + arrItems[x][1] + "</td></tr>";
strHtml += "</table></td> <td valign='top' ><input id='btnCierra' type='button' value=' ' class='Cerrar' onclick='Selecciona(-1, \"" + div.id + " \" , \"" + cmb.id + " \", \"" + txt.id + " \" );' /></td></tr></table></td></tr></table>";
div.style.visibility = 'visible';
div.innerHTML = strHtml;
}
hast aahi funciona correctamente, obtengo mis objetos y acceso a sus propiedades correctamente, el problema lo tengo en la siguiente funcion aesuq es invocada en mi variable strHtml que es otro objeto HTml una tabla..
Código:
function Selecciona(intVal, strDiv, strCmb, strTxt)
{
var div = document.getElementById(strDiv);
var txt = document.getElementById(strTxt);
var cmb = document.getElementById(strCmb);
....
codigo
...
}
en esta funcion ya no puedo ver los objetos html que envio vomo parametro, en esta funcion div, txt y cmb las tengo como null, alguien me podria indicar mi error o algun comentario..
saludos