最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

textarea - Need to make selected text as bolditalicunderline using javascript, or need very basic text editors suggestions - Sta

programmeradmin0浏览0评论

I am trying to figure out how to create a textarea with 3 buttons: bold, italic, underline. I cannot go with any WYSIWYG editor as I have tested most of them and no one fits my needs. (e.g. most are configurable and could give me the option to have the 3 buttons but problems e when I paste formatted text in the field. Even if I set everything up, with tinymce for example, I get problems.)

I really need a simple, basic, text editor with bold, italic, underline, and if I copy and paste formatted text in the textarea, I do not want it to act like a rich text editor, I want it to act like a real textarea, which will automatically remove ALL formatting. Peoples might say I could do it with properly-configured WYSIWYG editor but the answer is NO. I spent to many hours trying to configure the text editors to only accept bold, italic, underline and I got to many errors/bugs with all the well known WYSIWYG editors. I am not a programmer, I am a quality analyst so I'm used to find bugs.

Are there any suggestions on how to "create" a textarea with bold, italic, underline capabilities and that will only accept those functions? (not a rich text editor). With Javascript, I would like to avoid JQuery if possible.

I am trying to figure out how to create a textarea with 3 buttons: bold, italic, underline. I cannot go with any WYSIWYG editor as I have tested most of them and no one fits my needs. (e.g. most are configurable and could give me the option to have the 3 buttons but problems e when I paste formatted text in the field. Even if I set everything up, with tinymce for example, I get problems.)

I really need a simple, basic, text editor with bold, italic, underline, and if I copy and paste formatted text in the textarea, I do not want it to act like a rich text editor, I want it to act like a real textarea, which will automatically remove ALL formatting. Peoples might say I could do it with properly-configured WYSIWYG editor but the answer is NO. I spent to many hours trying to configure the text editors to only accept bold, italic, underline and I got to many errors/bugs with all the well known WYSIWYG editors. I am not a programmer, I am a quality analyst so I'm used to find bugs.

Are there any suggestions on how to "create" a textarea with bold, italic, underline capabilities and that will only accept those functions? (not a rich text editor). With Javascript, I would like to avoid JQuery if possible.

Share Improve this question edited Sep 24, 2013 at 20:15 Jeromy French 12.1k19 gold badges78 silver badges136 bronze badges asked Sep 15, 2011 at 14:10 MattiewMattiew 111 silver badge2 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

Have you considered or tried Aloha editor: http://aloha-editor/ It is simple, HTML5 patible and doesn't use iFrames. It does have problems in older versions of IE though.

TEXTAREA does not support formatting or any HTML tagging. There are no javascript tricks to change this.

You're going to have to roll-your-own or configure an existing editor.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论