On 1/7/07, mwaschkowski <[EMAIL PROTECTED]> wrote:

Thanks Tom, I appreciate the response, and understand what you have
said.

Normally I would use the appropriate DOM objects (like DIV in this
case) but I have a text area that has carriage returns in it, and I
need to grab the contents out, and then convert the returns to <br> and
then populate a label with the new value. I couldn't figure out a way
to properly apply the updated contents (which now has both text and
some <br> tags) without using innerHTML. If you (or anyone else) knows
of a better way to do this, I could then avoid using innerHTML
altogether...

All you have to do is split the text up into alternating text and br
tags. Something like this:

var splitlines = function (s) {
   var lines = s.split(/\r?\n/);
   var res = [];
   for (var i = 0; i < lines.length; i++) {
       res.push(lines[i]);
       res.push(BR());
   }
   return res;
}

-bob

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to