Link to home
Start Free TrialLog in
Avatar of vijayneema
vijayneema

asked on

CR/LF in Textarea

Hi all,

My application is generating this textarea tag, since it is generic application I cant change even a single line of HTML/Javascript code.

Can any one please help me what common character / escape sequence I can use to show new line in textarea & can pass that in javascript at the same time.

Generated TextArea Tag:
<textarea onBlur="setValue(this, 'abcd&#xa;efgh');">abcd&#xa;efgh</textarea>

Above code is giving error because of semicolon (;) in between single quote (')

Thanks in advance,
-Vijay
Avatar of divt
divt

Try this:

<textarea onBlur="setValue(this, 'abcd%0D%0Aefgh');">abcd&#xa;efgh</textarea>

Hope it helps.

Or this:

<textarea onBlur="setValue(this, 'abcd\u000D\u000Aefgh');">abcd&#xa;efgh</textarea>
Avatar of vijayneema

ASKER

My Question is "what common character / escape sequence I can use to show new line in textarea & can pass that in javascript at the same time."

It can be either

<textarea onBlur="setValue(this, 'abcd&#xa;efgh');">abcd&#xa;efgh</textarea>

Or

<textarea onBlur="setValue(this, 'abcd%0D%0Aefgh');">abcd%0D%0Aefgh</textarea>

Or

<textarea onBlur="setValue(this, 'abcd\u000D\u000Aefgh');">abcd\u000d\u000defgh</textarea>

& none of these are solving my problem :(

Please help.

Thanks,
-Vijay
Avatar of HonorGod
<textarea onBlur="setValue(this, 'abcd\u000D\u000Aefgh');">abcd<br>defgh</textarea>
ASKER CERTIFIED SOLUTION
Avatar of HonorGod
HonorGod
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I suspect that the issue is probably not with the semicolon (;) but instead with the single quote (') or double quote (")


Could you paste the actual code that takes the string?