Insert HTML entities in form elements with javascript |
Insert HTML entities in form elements with javascript |
Christian J |
Dec 18 2006, 03:37 AM
Post
#21
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
QUOTE This seems to work, though: CODE var foo='&'; document.write('<input value="'+foo+'">'); [.....] QUOTE Edit: seems the board renders my "&" into "&" now and then, especially in code examples. Best to check what one's posting! If you use quick edit entities are converted. Seems quoted replies are changed too, look at "var foo" above. Must test this more. |
Christian J |
Dec 18 2006, 04:03 AM
Post
#22
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
Here is what I saw. That's not what I got. I use a home-made favelet that shows the innerHTML (which normally includes rendered JS). Only IE6 changed the INPUT VALUE, the other ones retained "bleh". But you can't quite trust my favelet on this, it also renders "&" to "&" wherever it's found (including in the script). |
youngcomlover101 |
Feb 4 2007, 08:06 PM
Post
#23
|
Novice Group: Members Posts: 25 Joined: 4-February 07 Member No.: 1,780 |
Because most entities are missing on my keyboard. But I guess I could copy them from some reference... :-/ Can't you use this? http://imaginatorium.org/svc/unicode.htm \u0026 = & |
Lo-Fi Version | Time is now: 26th April 2024 - 10:23 AM |