Hi Experts,
I am trying this bit of code which is not working right.
<script language="JavaScript" type="text/JavaScript">
<!--
function showHide(divName)
{
var x = new getObj(divName);
document.writeln(x.name);
//document.writeln(x.value);
}
//-->
</script>
__________
document.getElementById("statusUpdate").innerHTML += "<input type='checkbox' id = 'demogexcel' name='demogexcel' value='DEMOG' onClick='showHide(\"demog\")'> Yes/ No </td> ";
document.getElementById("statusUpdate").innerHTML += "</tr><tr width='100%'><td width='100%' colspan='4' valign='middle' class='verdanablue'>";
document.getElementById("statusUpdate").innerHTML += "<iframe id=\"demog\" name=\"demog\" display='none' width='100%;' height='100px' border= '0px' bgcolor='e6e8ed' scrolling='yes' FRAMEBORDER=0 ></iframe></td>";
document.getElementById("statusUpdate").innerHTML += "</tr></table>";
Here, when the checkbox created innerHtml named demogexcel is clicked, the showHide function is called. I have also confirmed that demog value is passed to it correctly. However the line var x = new getObj(divName); does not create an object for the iframe - demog. Please can anybody help me with this.
I have also tried putting the name of the iframe in singlequotes.
I have tried the similar thing in another asp and it works perfectly fine, but in that case the iframe is created simple in a table and not in innerhtml of any object.
Is there any other alternative to doing this?
Thanks,
K