ExtJs textarea multiline edition

How can I assign text containing \ r \ n to the ExtJs text area and see how line breaks replace the actual \ r \ n characters? When I manually press Enter and check Firebug, I see how \ r \ n gets up. But if I assign a line containing \ r \ n to the text area, it displays as-is.

Any hints would be helpful.

+6
extjs textarea
source share
2 answers

I decided it myself. I used the "html" property to assign the text field \ r \ n-riddled. I changed it to β€œvalue” and it works like a charm. Anyway, thanks.

+5
source share

Try:

var text = text.replace('\r\n',"" + String.fromCharCode(13) + String.fromCharCode(10)); 
0
source share

All Articles