views:

505

answers:

1

I am writing a Firefox extension. When a user highlights and right clicks a selected text on a webpage, the extension captures the text and displays it in a textbox (xul window). The textbox shows the correct formating (like the line breaks, spaces, * for li tags.). But the problem happens when i try to store the textbox value in a variable. The line breaks are gone.

var selText = document.getElementById("txtboxSelectedText").value; //

Can anybody help?

Thanks a lot.

A: 

Is this a real textbox or a rich text editor like tinyMCE or open wysiwyg? In a real textbox there are linebreaks. In the rich text editors, they are really iframes with html content... what looks like a line break is really a <br/> tag.

The reason I suspect this is you can't have li tags (and their associated bullet points) inside a normal textbox

Jonathan Fingland
It is a normal textbox. The li tags are being shown as *.
Murali Bala