I have a function that creates input buttons dynamically...
function $NEW_BUTTON(id, content, parentId, cssclass, onclick)
{
var ctrl = document.create Element("input" );
ctrl.id = id;
ctrl.setAttribu te("name", id);
ctrl.setAttribu te("value", content);
ctrl.setAttribu te("class", cssclass);
ctrl.setAttribu te("type", "button");
ctrl.setAttribu te("onclick", "javascript :" + onclick);
$ID(parentId).a ppendChild(ctrl ); // equivalent to
document.getEle mentById()
}
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.create Element("input" );
ctrl.id = id;
ctrl.setAttribu te("name", id);
ctrl.setAttribu te("value", content);
ctrl.setAttribu te("class", cssclass);
ctrl.setAttribu te("type", "button");
ctrl.setAttribu te("onclick", "javascript :" + onclick);
$ID(parentId).a ppendChild(ctrl ); // equivalent to
document.getEle mentById()
}
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
Comment