468,296 Members | 1,269 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,296 developers. It's quick & easy.

How to display < and > in textarea

Hello.

I designed a form to edit some DataBase's fields. But some
of these fields contain '<' and '>' characters. And
these characters are '<' and '>' in HTML.

So if want to edit these fields, the form converts them
into '<' and '>'. And I want to mantain '&lt;' and '&gt;'

Mi piece of code:
----------
<textarea name=mytext rows=14 cols=60 wrap=virtual>$DBrow->text</textarea>
----------

Any suggestion? Thank you very much.
Jul 20 '05 #1
2 21822
Francesco Moi wrote:
I designed a form to edit some DataBase's fields. But some
of these fields contain '&lt;' and '&gt;' characters. And
these characters are '<' and '>' in HTML.

So if want to edit these fields, the form converts them
into '<' and '>'. And I want to mantain '&lt;' and '&gt;'


Use &amp; for &.
--
David Dorward <http://dorward.me.uk/>
Jul 20 '05 #2
Francesco Moi <fr**********@europe.com> wrote:
I designed a form to edit some DataBase's fields. But some
of these fields contain '&lt;' and '&gt;' characters. And
these characters are '<' and '>' in HTML.

So if want to edit these fields, the form converts them
into '<' and '>'. And I want to mantain '&lt;' and '&gt;'


You need to escape the ampersands as &amp; like this:

&lt; becomes &amp;lt;
&gt; becomes &amp;gt;
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"It said 'Insert disk #3', but only two will fit..."
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Donald Firesmith | last post: by
3 posts views Thread by ajay2552 | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.