Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another IE/Mozilla issue.....

Status
Not open for further replies.

tmilluah4

Programmer
Jan 16, 2007
8
US
I'm having one more issue with the Mozilla/Firefox browser...
This code works perfectly in IE but not in Mozilla.
It adds a new cell in a table row for a validation message but the new cell isn't being added for mozilla.


function displayInlineError(firingObj,errorText)" );
{
removePreviousError(firingObj);
var objTD = firingObj;

var i=0;

while (objTD.tagName != 'TD' && i < 20)
{
objTD=objTD.parentElement;
i++;
}


newCell = objTD.cloneNode(false);
newCell.name = 'ErrorSpan';

IT DOES NOT LIKE THIS LINE
var newNodeSpan = document.createNode('SPAN');
newNodeSpan .innerText = errorText;
newNodeSpan .className = 'fieldError';
newNodeSpan .firingObj = firingObj.id;
objTD.parentNode.appendChild(newCell);
newCell.appendChild(newNodeSpan );

}
 
Nevermind...Figured it out.

Its document.createElement('Span')
and
innerHTML instead of innerText
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top