PDA

View Full Version : html special characters in textarea


overbyte
10-23-2007, 01:57 PM
wotcha

having an unexpected bit of behaviour from my textarea.

It is set to html but when i use special characters like £ and " or try to escape characters with a backslash like \£ it all gets put in literally. As the data is fed into it from an external php text editor, this is a little bit tricky. It is definately rendering as html because i'm using html tags in the copy. I've attached a pic of the copy

Can anyone tell me what might be causing this?

danjp
10-23-2007, 03:30 PM
There seem to be so many things that can go wrong with dynamic text fields but there are few things that you should always check

make sure that you're using embedded fonts and that any special characters are included. (A good way to make bold text is available in your html text fields is to create a textfield off the stage and type something in there in plain text and some in bold text and do the embedding).

Another thing that you can do if you are using XML is to use CDATA wrappers around your nodes:
<node><![CDATA[wierd copy goes in here]]></node>

Also it is worthwhile setting your textfield properties manually:
myTf.html = true
myTf.embedfont = tue;
myTf.autoSize = true;
etc

hopefully one of these will sort it out :)

overbyte
10-23-2007, 11:04 PM
i've not used autosize but the others are set - would the height of the textbox affect it then?

overbyte
10-23-2007, 11:34 PM
the un-encoded pound sign seems to work - can anyone explain that?

i'm never.... never.... never using textareas again. Until next time. Probably.

thanks for your help

danjp
10-27-2007, 05:22 PM
not sure what the problem could be

are you using htmlText?

It is important that your XML file is saved as utf-8 and also that it has the proper doc type declaration