Jump to content

whats wrong? appendChild or what?


DanDaBeginner

Recommended Posts

i don't know whats wrong with my function, its working great in firefox and safari, but it does'nt in IE 6 and 7.. please help

 

function addKey()

{

globalSmartKey = true;

addS = document.getElementById("addS");

removeS = document.getElementById("removeS");

 

addS.style.display = "none";

removeS.style.display = "block";

 

var smartkey = document.getElementById("smartkey");

fields = ['Gender','DOB','Height','Weight'];

var p = document.createElement("p");

 

p.setAttribute("id","pSmart");

p.innerHTML = '<br /><strong>Please fill in the information below to set up your SmartKey. It will be pre-programmed and waiting for you when you arrive at the club.</strong><br />';

p.innerHTML +='<br /><small style="font-size:10px;">This information is private.  It is only used to pre-load your SmartKey so that it may provide you with accurate fitness information during and after your workout.</small><br />';

 

for(var t=0; t<fields.length; t++)

{

p.innerHTML += '<label for="fname">' +

'<span id="err' + fields[t] +'" class="error"></span>' +

'<span class="error">*</span>' + fields[t] +':' +

'</label>' +

'<input class="medium" id="' + fields[t] +'" name="' + fields[t] +'" type="text" value="" />';

}

 

p.innerHTML += '<br /><br />';

smartkey.appendChild(p);

}

Link to comment
https://forums.phpfreaks.com/topic/80486-whats-wrong-appendchild-or-what/
Share on other sites

i'm not positive, but at first glance I would think it may have to do with your use of the createElement function.

 

see http://www.byteclub.net/wiki/index.php?title=Javascript_createElement (first link returned when I googled the problem)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.