I’m loading an XML file with ajax, dynamically writing/reading values to/from HTML form textareas using jQuery, and then saving back to an XML file by passing it to a PHP-write function on a form submit.
What I’m looking for is a consistent way to handle line-breaks and paragraphs across HTML/jQuery/XML- Something where users would see actual line-breaks, not code, in html and form fields.
Up until now I’ve been using <br/> tags in CData fields in XML, but these show up in form fields, and jQuery is making a mess of my CData writes.
Any good ideas? Thanks-
If you use actual return characters in the text, then in order to make them show up when displaying as HTML, you could set the css property
white-space:preorwhite-space:pre-line.