S
ShutterMan
I have a function that creates input buttons dynamically...
function $NEW_BUTTON(id, content, parentId, cssclass, onclick)
{
var ctrl = document.createElement("input");
ctrl.id = id;
ctrl.setAttribute("name", id);
ctrl.setAttribute("value", content);
ctrl.setAttribute("class", cssclass);
ctrl.setAttribute("type", "button");
ctrl.setAttribute("onclick", "javascript:" + onclick);
$ID(parentId).appendChild(ctrl); // equivalent to
document.getElementById()
}
In both IE7 and FF3, the buttons are created. But in Firefox, the
value of the button is always "undefined". (In IE its correct). Any
ideas?
Thanks
function $NEW_BUTTON(id, content, parentId, cssclass, onclick)
{
var ctrl = document.createElement("input");
ctrl.id = id;
ctrl.setAttribute("name", id);
ctrl.setAttribute("value", content);
ctrl.setAttribute("class", cssclass);
ctrl.setAttribute("type", "button");
ctrl.setAttribute("onclick", "javascript:" + onclick);
$ID(parentId).appendChild(ctrl); // equivalent to
document.getElementById()
}
In both IE7 and FF3, the buttons are created. But in Firefox, the
value of the button is always "undefined". (In IE its correct). Any
ideas?
Thanks