471,831 Members | 1,287 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,831 software developers and data experts.

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 22643
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
NeoPa
reply views Thread by NeoPa | last post: by
reply views Thread by YellowAndGreen | last post: by
aboka
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.