I have a function that creates 'select' controls:
var newInput4 = document.createElement("select");
newInput4.setAttribute("id","phonetype" + (howmanyrows+1));
newInput4.onchange = new Function("pt1(" + spanStart.id + ", " + newInput4.id + ")");
After this object is created (newTD2.appendChild(newInput4)
-- the function pt1() attempts to access the selection through:
var pt = document.getElementById(select);
phoneType = pt.value;
However, it tells me the ID (the value of select) is undefined.
Why can't I access the object I've created? I've also tried document.all.phonetype2...... and this does not work either.
PLEASE HELP!!
var newInput4 = document.createElement("select");
newInput4.setAttribute("id","phonetype" + (howmanyrows+1));
newInput4.onchange = new Function("pt1(" + spanStart.id + ", " + newInput4.id + ")");
After this object is created (newTD2.appendChild(newInput4)
var pt = document.getElementById(select);
phoneType = pt.value;
However, it tells me the ID (the value of select) is undefined.
Why can't I access the object I've created? I've also tried document.all.phonetype2...... and this does not work either.
PLEASE HELP!!