站长日记 > HTML > 正文

文本框 尖括号

2012-08-08   来源:站长日记       编辑:沧海桑田   类别:HTML    转载到:    发表评论

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:
----------

----------
Any suggestion? Thank you very much.


> 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;'[/color]

Use &amp; for &.

> 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;'[/color]

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

&lt; becomes &amp;lt;
&gt; becomes &amp;gt;
--

0

0
0|0 | 鲜花 VS 砸蛋 | 13阅读 0评论
上一篇: 亲,没有了
下一篇: mailto
 
不想登录?直接点击发布即可作为游客留言。
昵称  邮箱 网站 验证码 = 1+1