[thelist] Dealing with special characters in forms

shawn allen shawn at alterior.net
Fri Jan 3 16:58:18 CST 2003


quoth Keith:
> At 01:13 PM Friday 1/3/2003, you wrote:
> >I'm having a problem with a form filled textarea and special characters.
> >When the form is submitted to be parsed by a PHP script, all the special
> >character entities are presented to the script as translated text.
>
> try placing your textarea inside of pre tags to retain preformatting
>
> <pre>
> <textarea id="b88" name="body[88]" cols="72" rows="12">
> <p>&pound; &lt;= crazy</p>
> </textarea>
> </pre>

That's not right... How about encoding those character entities?

<textarea>
&lt;p&gt;&pound; &lt;= crazy&lt;/p&gt;
</textarea>

WRT validity, <textarea> my *not* contain any other elements:
<http://www.w3.org/TR/html4/interact/forms.html#edef-TEXTAREA>

--
shawn allen
  mailto://shawn@alterior.net
  phone://415.577.3961
  http://alterior.net
  aim://shawnpallen




More information about the thelist mailing list