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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.