PDA

View Full Version : end-of-line problem with Ext.form.TextArea



kchiu
15 Nov 2009, 5:54 PM
Hi,

I have a problem when displaying multi-line text in Ext.form.TextArea.

When in IE, TextArea displays multi-line text with the DOS-style CRLF ('\r\n'). But in Firefox or Chrome, it uses the Unix-style LF ('\n'). This causes 2 problems:

1) The EOL character is inconsistent when the text from different browsers is saved to DB. (and I have no control what browser will be used)

2) When checking if TextArea's text has changed from the original one fetched from the DB, it always appears 'changed' if IE is used to display the Unix-style text, or if Firefox/Chrome is used to display the DOS-style text.

So, is there away to ensure the TextArea's EOL character is always consistent across the different browsers? I probably don't need to be picky which one to use (though would use CRLF if can choose), it just needs to be consistent.

Any idea how to do that?

Thanks a lot, cheers.