Wednesday, December 9, 2009

TextArea line breaks in IE

I've spent several days wrestling with this problem. I have two almost identical pages, which both pull data in from the same XML stream.

On one page I display the data in a textarea, and on the other I add a few lines and then display it in a textarea.

In Firefox it worked fine, however in Internet Explorer the line breaks in the text were stripped out.

I tried everything, and then realized that on the working page, I was using:

element.value = displayText

and on the other

element.innerHTML = displayText

Changed the innerHTML to value, and it worked perfectly.

Go figure!

No comments:

Post a Comment