English 中文(简体)
• 如何使输入文本领域的超文本能力?
原标题:How to enable HTML in input text field?
  • 时间:2011-11-23 13:50:38
  •  标签:
  • html
  • forms

我如何能够在文本领域允许超文本,使用户能够在文本领域和提交时进入超文本,使超文本在浏览器中平分和显示? 现在,在案文领域采用正常形式要素的Im是:

<input id="todo" type="text">

我需要改变什么? <代码> 类型?

问题回答

你不需要做任何事情。 超文本是文本,因此用户如愿意,可将超文本打成正文。

将类型改为html 简而言之,它是一种不为人所知的类型,因此浏览器将其视作<条码>。

如果你接受超文本,那么你在把它重新显示给浏览器之前,就必须谨慎地加以净化,否则,你就会打开。 XSS 安全脆弱性

If you would like to enable HTML markup in input field, use <textarea id="todo"></textarea> It will give you a much bigger box.

Optionally you can use TinyMCE which is easy to use and powerful WYSIWYG tool.

But to show the code when submitted you need to know PHP, Python programming language or something like those.

你所期待的是所谓的世界青年协会编辑。 (见你所想的东西)

你们有很多,有些是免费的,只有谷歌“WYSIWYG”编辑,见到 yourself。

我曾经使用。 尽管我相信,现在已经有了更好的编辑,但这种编辑非常简单和有力。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签