oh i get it now... yeah that happens if u're using the .text() method of jquery... but you're saying the .html() method also causes that behavior?
On Sun, Sep 13, 2009 at 6:48 PM, Paul <[email protected]> wrote: > > Robert, > > Not sure I understand your suggestion on using <pre> should I wrap > that around my span? > > In Firebug when I get the value of the textarea element is does > contain the '\n\n' newlines. As I mentioned I found and used a JS > routine that functions like the PHP nl2br which basically replaces the > '\n' with '<br />'. The problem then is the '<br />' displays > literally as '<br />' in the span text instead of an actual break. > > P- > > > > > > On Sep 13, 2009, at 6:25 PM, Robert Banh wrote: > >> >> are the newlines being removed by jquery? try <pre> or <xmp> tags? >> >> if you use firebug to view the dynamic data in the span tag, does it >> display newlines in there? >> >> rob >> >> >> >> On Sun, Sep 13, 2009 at 6:15 PM, Paul <[email protected]> wrote: >>> >>> Greetings all, >>> >>> Working on the JS/jQuery this rainy Sunday afternoon. I've trying to >>> capture submit on a form and update a span on the page with the value >>> from the textarea. The mechanics of submit intercept and updating the >>> field is somewhat trivial. What I've having trouble with is the >>> formatting of the span. The value of the span when the page is loaded >>> may contain 1-n number of paragraphs. When the user submits the form >>> when I update the span via jQuery text() or html() I loose all >>> formatting. In other words no breaks on the paragraphs. I've even >>> tried adding some nl2br JS code I found but this just puts the <br /> >>> code into the span but it doesn't get rendered by the browser. >>> >>> Sadly this is part of a large plugin I'm working on so can't really >>> provide sample code. >>> >>> Any thoughts would be appreciated. >>> >>> Paul >>> >>>> >>> >> >> > > > > > > --~--~---------~--~----~------------~-------~--~----~ Our Web site: http://www.RefreshAustin.org/ You received this message because you are subscribed to the Google Groups "Refresh Austin" group. [ Posting ] To post to this group, send email to [email protected] Job-related postings should follow http://tr.im/refreshaustinjobspolicy We do not accept job posts from recruiters. [ Unsubscribe ] To unsubscribe from this group, send email to [email protected] [ More Info ] For more options, visit this group at http://groups.google.com/group/Refresh-Austin -~----------~----~----~----~------~----~------~--~---
