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
efgh');">abcd&#x a;efgh</te xtarea>
Above code is giving error because of semicolon (;) in between single quote (')
Thanks in advance,
-Vijay
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
efgh');">abcd&#x
Above code is giving error because of semicolon (;) in between single quote (')
Thanks in advance,
-Vijay
Or this:
<textarea onBlur="setValue(this, 'abcd\u000D\u000Aefgh');"> abcd
e fgh</texta rea>
<textarea onBlur="setValue(this, 'abcd\u000D\u000Aefgh');">
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
efgh');">abcd&#x a;efgh</te xtarea>
Or
<textarea onBlur="setValue(this, 'abcd%0D%0Aefgh');">abcd%0 D%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
It can be either
<textarea onBlur="setValue(this, 'abcd
efgh');">abcd&#x
Or
<textarea onBlur="setValue(this, 'abcd%0D%0Aefgh');">abcd%0
Or
<textarea onBlur="setValue(this, 'abcd\u000D\u000Aefgh');">
& none of these are solving my problem :(
Please help.
Thanks,
-Vijay
<textarea onBlur="setValue(this, 'abcd\u000D\u000Aefgh');"> abcd<br>de fgh</texta rea>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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?
Could you paste the actual code that takes the string?
<textarea onBlur="setValue(this, 'abcd%0D%0Aefgh');">abcd&#
Hope it helps.