The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

2 Pages V < 1 2  
Reply to this topicStart new topic
> Insert HTML entities in form elements with javascript
Christian J
post Dec 18 2006, 03:37 AM
Post #21


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



QUOTE(pandy @ Dec 18 2006, 01:27 AM) *

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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Dec 18 2006, 04:03 AM
Post #22


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



QUOTE(pandy @ Dec 18 2006, 01:40 AM) *

Here is what I saw.


That's not what I got. mellow.gif 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 "&amp;" to "&" wherever it's found (including in the script).

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
youngcomlover101
post Feb 4 2007, 08:06 PM
Post #23


Novice
**

Group: Members
Posts: 25
Joined: 4-February 07
Member No.: 1,780



QUOTE(Brian Chandler @ Dec 17 2006, 09:54 AM) *

QUOTE(Christian J @ Dec 18 2006, 02:26 AM) *

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 = &
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

2 Pages V < 1 2
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 26th April 2024 - 10:23 AM