JavaScript WYSIWYG Editor

TinyEditor is a simple JavaScript WYSIWYG editor that is both lightweight (8KB) and standalone. It can easily be customized to integrate with any website through CSS and the multitude of parameters. It handles most of the basic formatting needs and has some functionality built in to help keep the rendered markup as clean as possible. The icons are courtesy of famfamfam and have been combined into a sprite so there are only a few HTTP requests for the editor. I plan on adding some updates in the future to support font color, a full-screen mode, and a paste from Word option.

To initialize the script use the following:

new TINY.editor.edit('editor',{
	id:'input', // (required) ID of the textarea
	width:584, // (optional) width of the editor
	height:175, // (optional) heightof the editor
	cssclass:'te', // (optional) CSS class of the editor
	controlclass:'tecontrol', // (optional) CSS class of the buttons
	rowclass:'teheader', // (optional) CSS class of the button rows
	dividerclass:'tedivider', // (optional) CSS class of the button diviers
	controls:['bold', 'italic', 'underline', 'strikethrough', '|', 'subscript', 'superscript', '|', 'orderedlist', 'unorderedlist', '|' ,'outdent' ,'indent', '|', 'leftalign', 'centeralign', 'rightalign', 'blockjustify', '|', 'unformat', '|', 'undo', 'redo', 'n', 'font', 'size', 'style', '|', 'image', 'hr', 'link', 'unlink', '|', 'cut', 'copy', 'paste', 'print'], // (required) options you want available, a '|' represents a divider and an 'n' represents a new row
	footer:true, // (optional) show the footer
	fonts:['Verdana','Arial','Georgia','Trebuchet MS'],  // (optional) array of fonts to display
	xhtml:true, // (optional) generate XHTML vs HTML
	cssfile:'style.css', // (optional) attach an external CSS file to the editor
	content:'starting content', // (optional) set the starting content else it will default to the textarea content
	css:'body{background-color:#ccc}', // (optional) attach CSS to the editor
	bodyid:'editor', // (optional) attach an ID to the editor body
	footerclass:'tefooter', // (optional) CSS class of the footer
	toggle:{text:'source',activetext:'wysiwyg',cssclass:'toggle'}, // (optional) toggle to markup view options
	resize:{cssclass:'resize'} // (optional) display options for the editor resize
});

The first parameter taken by TINY.editor.edit is the variable name used for the object instance. Keep in mind that before posting you will need to call the instance.post() function to ensure that the latest changes in the WYSIWYG translate into the text area. This script has been tested in all major browsers and is available free of charge for both personal or commercial projects under the creative commons license. Community support is available here. Paid support is also available, contact me for details.

Click here for the demo.

Click here to download the source code.

1/8/2010 – Resolved a couple IE and Chrome issues and added some cleanup for Safari/Chrome. Thanks for the reports.

1/12/2010 – Resolved issue with conversion to lower case and the header row class.

Posted by Michael in JavaScript on February 8, 2010

188 Responses

In the chrome has bug when click on the source.

ZeroZ on February 08, 2010 at 1:51 am

Nice work, thanks for the effort! Any chance of generating P tags when user hits enter?

Alen on February 08, 2010 at 2:11 am

Nice Work! I'm looking forward to use it somewhre ;-)

Bernard Teske on February 08, 2010 at 2:24 am

its awesome. realy :)

enver on February 08, 2010 at 3:34 am

Automatic <p> tags are a must for me.
I also found a bug, when I try to make a word bold, then go into source view, and back again, the word disappears.

Boris Strahija on February 08, 2010 at 4:42 am

You did it again. I really like the bottom button where you can switch between Source and WYSIWYG. Good looking and it can fit easily in any design.

Great work, Michael.

Andy Gongea on February 08, 2010 at 4:55 am

I have heard such great things about this library, I am sure it will get more attention.

Jordan Walker on February 08, 2010 at 8:42 am

@Alen and Boris – Absolutely, will work on adding that functionality today. Thanks for the suggestion.

@Boris – Thanks for the report, working on a resolution now. May be an IE only issue.

Michael on February 08, 2010 at 9:26 am

Great job! I'll definitely be keeping an eye on this as an alternative for TinyMCE and CKEditor. Bookmarked.

Benjamin @ Virtuosi Media on February 08, 2010 at 10:02 am

Finally a small WYSIWYG editor that works!

My one suggestion would be to give the focus back to the same spot in the editor when the user clicks something like the ol or ul buttons. Right now you have to do the extra click of putting the cursor back to the editor.

Ryan Haugh on February 08, 2010 at 10:20 am

@Ryan – Great suggestion, will add it to my short list. Thanks.

Michael on February 08, 2010 at 10:39 am

Hi, thanks for your great work. I have one little note, it would be best if i show it to you on simple example: let's assert that i am writing a text. Now, i want to make some text bold – i click bold button, but i have to click into textarea – the focus is destroyed when i click bold. Could you fix that?

Thanks.

CZ_nette on February 08, 2010 at 12:17 pm

Oh, sorry, now i see that @Ryan have already written that.

CZ_nette on February 08, 2010 at 12:18 pm

Nice work very impressive

Keir Lavelle on February 08, 2010 at 1:31 pm

Wow, i really like the look of this editor…. you rock man !

Luglio7 on February 08, 2010 at 2:12 pm

Michael,

I really like the simplicity of this script. Of all of the WYSIWYG editors I've seen, this is the cleanest. I'm having an issue implementing it in a custom PHP CMS, but when I post the form, the changes don't commit. However, if I press the source button, or press it and go back to the WYSIWYG editor, the changes commit. It's almost like there needs to be a save button, because something is going on behind the scenes when I switch over to the source that makes it work. Thanks if you can be of any help, and if not, thanks for the great script anyway.

John B on February 08, 2010 at 4:07 pm

Am I missing something here? I threw this in a form and submitted and nothing posts from the text area… Yes I know I can traverse and grab the value, but why won't it post normally? Is there a method to commit the data from the iframe back into the text area?

Ryan on February 08, 2010 at 4:47 pm

@John B and Ryan – Per the post… "Keep in mind that before posting you will need to call the instance.post() function to ensure that the latest changes in the WYSIWYG translate into the text area." Hope that answers your questions.

Michael on February 08, 2010 at 5:05 pm

lol, I got excited by how clean it all looks, I didn't bother to read the rest of your post… my bad!

Ryan on February 08, 2010 at 6:49 pm

looks nice, I specially like the design – will be trying it out soon.

Web Development on February 08, 2010 at 11:34 pm

How to change the default font?

Waqas Tariq on February 09, 2010 at 5:43 am

@Waqas – You would need to set it on the css property (i.e. css:'body{font-face:Georgia;Verdana} or user the cssfile property.

Michael on February 09, 2010 at 9:08 am

Nice one, i will follow the evolution of your wysiwyg. If you need help for french traduction of your editor, i can do that.

Djolhan on February 09, 2010 at 10:13 am

Nice,
But can you add Direction button that add style="direction:rtl" or style="direction:ltr" for right-to-left languages?

Mahdi Yousefi on February 09, 2010 at 12:40 pm

Helo ! Good Job !
However , if you list more 1 tinyeditor (with her 'id…') the resize bug ! Only the last tinyeditor resize take effect !

Help please ? ! :(

liandri on February 09, 2010 at 3:05 pm

great script once again – I see the word pasting hasn't been figured out yet, I have been battling this myself. It is actually pretty important due to 90% of web users not realising that pasting from word etc is a killer on these editors…
I look forward to an elegant solution as always

simon on February 10, 2010 at 1:58 pm

@liandri – Not sure if I understand what you are trying to say. Please take it to the forum.

@simon – Thanks, hope to have it available soon.

Michael on February 10, 2010 at 3:09 pm

Very nice.
Very fast and easy to integrate.
I wrote to file for quick submit testing.

One issue: In IE7, 'insert hyperlink' gives prompt to allow scripted windows. Once allowed the URL window appears, but clicking OK does not result in a hyperlink appearing in the textarea.

Same thing in FF3, (without scripted windows prompt)

Works fine in Chrome.

bob on February 10, 2010 at 4:11 pm

Are you planning any build for Joomla or Drupal? Would love to substitute the one Joomla comes pre-packaged with. Thx for all the hard work in this WYSIWYG editor.

Randy Comeau on February 10, 2010 at 7:31 pm

Very NICE!
any chance of an image browser instead of the simple image link insert method?

Murray on February 11, 2010 at 12:22 am

@bob – Odd, I am not seeing that, perhaps locally but are you testing from a server?

@Randy – Not planning on it but I welcome anyone else to integrate the two.

@Murray – Perhaps a tutorial in the future. That would be a server-side deal, preferably AJAX based, since you would be uploading files.

Michael on February 11, 2010 at 12:30 am

Yes, I'm testing from a server, and not a localhost.

Insert image works fine.

But insert link does not work in IE7 or FF3.
I'm not using any custom security browser settings.

Using Vista, but doubt if that's germane.

Can provide testing url if you like.

bob on February 11, 2010 at 8:18 am

@bob – Yes, a test link would be great. You can use the contact page linked to in the footer.

Michael on February 11, 2010 at 10:07 pm

Great job. I looked so much a cross-browser WYSIWYG editor. Thanks that you share it with us.

AccesInterzis on February 12, 2010 at 4:35 am

I guess no one is really using the forum yet? http://forum.leigeber.com/topic/124-tolowercase-rewrite/

jdigital on February 12, 2010 at 10:16 am

I found an issue when you want to use a different rowclass. The default is "teheader". If I change it something else then it doesn't change in all locations. The fix is really simple though: change the following:
h.className='teheader';
to
h.className=obj.rowclass||'teheader'
on line 40.

Ryan Haugh on February 12, 2010 at 5:47 pm

Ok there's more to the problem than it just lowercasing some things it shouldn't. http://forum.leigeber.com/topic/124-tolowercase-rewrite/

jdigital on February 12, 2010 at 7:39 pm

@jdigital – Fixing the issue now, thanks for reporting.

@Ryan – Thanks for letting me know, also fixing to upload the fix.

Michael on February 12, 2010 at 7:44 pm

Ryan i posted a new lowercase fix that seems to be working…still the other issues.

jdigital on February 12, 2010 at 8:32 pm

I like this editor a lot. But I cannot use it in my projects because of one main missing feature – maybe a bug. If you type some text without any formating it should be a paragraph by default. If I render typed text inside <div></div> there should be a paragraph inside. It is really hard to learn clients to select text everytime when they type something and assign a paragraph style to it. They do not understand this stuff. Anyway many other editors do this by default (TinyMCE, KCEditor etc.). Is it planned to add this to TinyEditor or is it possible to set this up in the settings somewhere?
Thanks for answer.
Luke

Luke on February 13, 2010 at 3:56 am

This works great for my easy little input form.
So i found out to get the current content if have to call editor.post();
The i get it like alert($("#input").val()); (with jquery)

But how can i update the content dynamicaly?
$("#input").val("Test"); will not change the displayed content.

Garbor on February 14, 2010 at 10:50 am

This script crashes TINY accordion if used on the same page, Leigeber…

bakkelun on February 16, 2010 at 3:37 am

I like this editor very much can i use in asp.net
because i tired to access the value from this editor server side but it returns nothing

umesh on February 17, 2010 at 5:47 am

I tinyeditor.js, line 36 : l=obj.controls.length
and then in line 40: for(i;i<l;i++){

Hence the Question:
How to use it with an array of textarea WITHOUT repeating the
<script type="text/javascript">
new TINY.editor.edit('editeur<?php echo $i ?>',{
id:'editeur<?php echo $i ?>',
width:480,
height:160,
cssclass:'te',
controlclass:'tecontrol',
rowclass:'teheader',
dividerclass:'tedivider',
controls:['bold','italic','underline','strikethrough','|','subscript','superscript','|',
'orderedlist','unorderedlist','|','outdent','indent','|','leftalign',
'centeralign','rightalign','blockjustify','|','unformat','|','undo','redo','n',
'font','size','style','|','image','hr','link','unlink','|','cut','copy','paste','print'],
footer:true,
fonts:['Verdana','Arial','Georgia','Trebuchet MS'],
xhtml:true,
cssfile:'style.css',
bodyid:'editeur<?php echo $i ?>',
footerclass:'tefooter',
toggle:{text:'source',activetext:'wysiwyg',cssclass:'toggle'},
resize:{cssclass:'resize'}
});
</script>
section ?

Eman on February 18, 2010 at 12:40 pm

Thank you very much. This is just what I needed. Lightweight, functional and fast! Excellent work!

Robbe C. on February 24, 2010 at 4:46 am

This is a great editor!!! I cannot get, nor do I understand, the instance.post(). Can someone please help me? On my form I have <input name="Update" type="submit" value="Update and Close" OnClick="instance.post();"> but I get an error saying "operation not allowed when the object is closed" but my close statement is the very last thing in my code.

Thanks!!!

web on February 26, 2010 at 6:22 pm

@web – the last reply

On your form tag itself add the instance.post();

<form onsubmit="instance.post();" action="">
^instance should be the actual instance of the object and not just instance… So you need to store the editor object in a variable when you create it first.

var instance = new TINY.editor.edit()

Mike on March 01, 2010 at 12:25 pm

Hi, this is Robert. I have tried this editor in Chrome and is working fine but not tried in IE or Firefox. However will check to see if it can be done in asp.net

Web Development on March 04, 2010 at 1:14 am

Thanks Mike, that helps. I am obviously missing something though because the error went away but once I submit the form it is not updating my database. Here is my code:

<!–#include virtual="/_inc/connections.asp"–>

<html>
<head>
<title>Edit Page</title>
<style type="text/css">
.te {border:1px solid #bbb; padding:0 1px 1px; font:12px Verdana,Arial; margin:25px}
.te iframe {border:none}
.teheader {height:31px; border-bottom:1px solid #bbb; background:url{_media/images/header-bg.gif) repeat-x; padding-top:1px}
.teheader select {float:left; margin-top:5px}
.tefont {margin-left:12px}
.tesize {margin:0 3px}
.testyle {margin-right:12px}
.tedivider {float:left; width:1px; height:30px; background:#ccc}
.tecontrol {float:left; width:34px; height:30px; cursor:pointer; background-image:url(_media/images/icons.png)}
.tecontrol:hover {background-color:#fff; background-position:30px 0}
.tefooter {height:32px; border-top:1px solid #bbb; background:#f5f5f5}
.toggle {float:left; background:url(_media/images/icons.png) -34px 2px no-repeat; padding:9px 13px 0 31px; height:23px; border-right:1px solid #ccc; cursor:pointer; color:#666}
.toggle:hover {background-color:#fff}
.resize {float:right; height:32px; width:32px; background:url(_media/images/resize.gif) 15px 15px no-repeat; cursor:s-resize}
#editor {cursor:text; margin:10px}
</style>
<script type="text/javascript" src="_inc/tinyeditor.js"></script>
</head>
<body bgcolor="#666666" margin="0" marginheight="0" marginwidth="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<table width="99%" border="1" bordercolor="#000000" bgcolor="#FFFFFF" cellpadding="20" cellspacing="5" align="center">
<tr>
<td>
<%
If Request.Form <> "" Then
SQL = "UPDATE TABLE SET FIELD = '" & Request.Form("Content") & "', Effective = '" & Now() & "' WHERE Page_ID = " & Page
cmd.CommandText = SQL
cmd.Execute
Response.Write "<div style=""background:#e2f9e3; border:1px solid #6fa152; padding:10px; border-color:#7eb45c; height:40;"">  <img src=""_media/images/saved.gif"" align=""middle""> <font color=""#6fa152"" face=""Trebuchet MS"" font-size=""11px"">Your changes have been saved.</font></div>"
End If
SQL = "SELECT * FROM TABLE WHERE Page_ID = " & Page
rs.Open SQL, Conn
%>
<form action="pages.asp?page=<%=Request.QueryString("page")%>" method="post" name="Edit" target="_self" onSubmit="instance.post();">
<span class="effective">Last Modified: <% Response.Write rs.Fields("Effective") %></span>
<textarea id="input" name="Content" style="width:450px; height:200px" class="content"><% Response.Write rs.Fields("Content") %></textarea>
<script type="text/javascript">
new TINY.editor.edit('editor',{
id:'input',
width:650,
height:325,
cssclass:'te',
controlclass:'tecontrol',
rowclass:'teheader',
dividerclass:'tedivider',
controls:['bold','italic','underline','strikethrough','|','subscript','superscript','|',
'orderedlist','unorderedlist','|','outdent','indent','|','leftalign',
'centeralign','rightalign','blockjustify','|','unformat','|','undo','redo','n',
'style','|','image','hr','link','unlink','|','cut','copy','paste','print'],
footer:true,
fonts:['Verdana','Arial','Georgia','Trebuchet MS'],
xhtml:true,
cssfile:'style.css',
css:'body{font-family:Trebuchet MS; font-size:12px; color:000000;}',
bodyid:'editor',
footerclass:'tefooter',
toggle:{text:'source',activetext:'wysiwyg',cssclass:'toggle'},
resize:{cssclass:'resize'} });
</script>
<div align="center">
<input name="Update" type="submit" value="Update">
<input name="Close" type="button" value="Close" OnClick="javascript:window.close();">
</div>
</form>
<%
rs.Close
%>
</td>
</tr>
</table>
</body>
</html>

web on March 05, 2010 at 3:55 pm

Hi Michael,

I have a problem using this control in asp.net. I use it with a textarea control and everything works fine. The problem comes when I add the attribute runat="server" to the textarea because I want to take the value from that control in the code behind.

Did you try this in the past?

Thanks,
Mauro

Mauro on March 08, 2010 at 8:50 pm

Always lightweight and "no fuss" however it doesn't matter if the editor can't handle hard and massive abuse from ORDINARY users. Coders and web site designers doesn't really have problem with markup but the ordinary users do.

It's the same people that keep on insisting to copy + paste directly from Microsoft Word and they'll keep doing it no matter what so any editor that can't handle that sort of abuse a 100% is doomed to fail.

And what's up with all the <div></div>? 100% semantic + 100% idiot-safe = 100% win. :)

I'll keep this editor in mind though since we're looking to test some new editors anyway.

Tommie Hansen on March 09, 2010 at 9:10 am

Hi,

Could you please add focus and blur events when you click on the textarea and click away from it.

I've tried a few lightweight javascript and jquery textareas but I cant seem to find or incorporate this functionality. Would be great if you could add this for me:)

Thanks

Paul on March 09, 2010 at 10:11 am

Hi,
Thank you for a Excellent editor.
I'm not good at English so please understand me.

There is a bug without IEs.
Do style Italic and then switch source view and wysiwyg view.
Where is the Italic style…?

And then switch source view again.
What is "font-weight:italic;"?

Please fix it… Thanks.

Yang Taegyu on March 10, 2010 at 7:44 pm

ok, so, there is a bug when submitting the form and using tinyedit. if i type stuff in wysiwyg mode and just submit, it will NOT $_POST, but, if i switch it to html mode and submit, it will, or if i swith to html and back to wysiwyg, it will submit, unless i start typing more, and if i submit after typing more, it will only submit what was las typed before switching back to wysiwyg mode. i really like your editor and would love to use this, but, that is a HUGE problem. please let me know when this is fixed.

Justin on March 11, 2010 at 10:17 am

@web

as Mike pointed out, you need to name your instance of the object:

<script type="text/javascript">
var instance = new TINY.editor.edit('editor',{ …

that should get it if you haven't already figured it out …

Liz on March 11, 2010 at 11:07 pm

While testing demo I made random keypresses and clicks on tollbar.

The result code surprised me: "<h1><font size="3"><strong>jnkjbnkxcvbvbvcbbvvvb</span></strong>bbvcxv</font></h1>"

Open SPAN is missed.

Button on toolbar seems not to be indicating their state (pressed or not). Looks like usability issue.

Stac on March 15, 2010 at 7:55 am

Amigos, he estado biendo el editor y esta genial facil de implementar, pero se me ha presentado el siguiente problema:
Tengo un problema con este editor cuando hago un submit a un formulario y el campo textarea donde esta el editor me lo envia vacio.
He agregado en la linea del form
<form method="post" name="temas" onSubmit="instance.post();"> pero aun sigue sin funcionar, la unica manera es hacerle view code y asi si manda el texto.
Me gustaria me dieran un ejemplo de como implementarlo con un formulario y un textarea

Gracias

Ernesto on March 15, 2010 at 2:32 pm

I like all the scripts you have on your site, they are all very functional, cross-browser compatible and very lightweight! Thanks for sharing the code . . . we need more developers like you

Ben on March 16, 2010 at 11:03 am

Thanks

I have a small project I was going to create something similar but this will work just fine.

Purencool on March 21, 2010 at 11:01 pm

How do i add custom buttons to this editor? i want to be able to select a block of text and click a button to wrap that block of text with a tag(such as <pre class="code-js"></pre>)

Kevin on March 22, 2010 at 12:01 pm

Hi nice work ! Simple, nice speed perfect BUT lol
Would be perfect if to add upload of photos to add to in the text.
It is possible?

Another suggest, add entitles change ISO-8859-1, UTF-8 : )

Ty dude !!! Congratulations

Kin on March 26, 2010 at 1:09 pm

I am going to work out how to integrate this into a few projects I have been working on. I have searched for days, looking for a WYSIWYG editor this simple and easy to use!!

Congrats!

Simon on April 02, 2010 at 9:06 am

very nice work, thanks for sharing once again

would be helpful and much appreciated if you could share source with full variable names (at a cost?)

dimitris on April 02, 2010 at 12:05 pm

hi guys, How can I get the content using javascript?

JoeyV on April 05, 2010 at 9:03 pm

Nice work ! Personally, I'm using FCKEditor because it's integrate with Drupal and you can plugins allow you to upload photo. But i will try TinyEditor. Good post !

Web development Beijing on April 08, 2010 at 7:03 am

A W E S O M E , easy, tiny, perfect

me on April 09, 2010 at 7:33 am

Great work! I have tried to add a "paste from Word" function with no luck, any ideas? A button would work fine, but even better a automatic cleaning on paste. Reading keystrokes ctrl-v will not work, since right click + paste will not trigger the event. Also, there are more and more mac users out there.

So – any ideas? Thanks

Peter on April 09, 2010 at 9:14 am

Hi,
Great app, thanks.

Please add <p> wrapping for all browsers.
This is needed .

markiz on April 10, 2010 at 2:56 am

Easy, tiny, thanks a lot for this great work !!!

Is it possible to add custom button like <!– more –> ?

Tahola on April 12, 2010 at 8:11 am

great job. i wanna konw how to put the toolbar on the foot? thanks

BenC on April 14, 2010 at 7:06 am

hey thanks so much for the source code. One quick question though, am I allowed to take this source code and add to it and use it on my site?

Noah Rainey on April 19, 2010 at 9:23 pm

Thanks for this script. I was looking for this for a while now.

Anyway just something for the Noobs (like me). Not only should you not forget to use the instance.post(), but also do not forget to give your textarea a name…

I don't know why I forgot this, but I just spend 2 hours trying to find out why the script didn't post my data… {feeling kinda stupid right now…}

Basz on April 21, 2010 at 7:48 am

thanks so much for the source code.

<a href="http://www.comnez.com">Website Design & Development</a>

prateek on April 26, 2010 at 12:15 am

Hello, this is a very useful WYSIWYG editor and it is much appreciaqted, but it does not work under Firefox 3.5+, I have tested it under IE7-IE8, Chrome and Opera and it does work, not on Firefox however, any ideas?

Hector Rojas on April 26, 2010 at 10:34 am

Hi there!

Great editor.. The size and functionality makes me very happy. 2 questions though, in the beginning people talked about the not automatic re-focus after clicking a button. How are things with that? And the second one, people also recommended earlier to enter automatic paragraphs.

Could you give me a status?

Greetz,
Lars

Lars on April 27, 2010 at 2:44 am

This is a wonder texteditor, and a great effort.

Shopping Cart on April 27, 2010 at 4:14 am

Guys I read all of your comments. If you want a kick ass editor get the CKEditor. It has everything you need. Copy from word and easy to use.

Micheal your Editor is nice and lightweight, but there are better things out there.

Rudi on April 28, 2010 at 5:26 am

@Rudi – CKEditor is too heavy. This a great editor and I prefer this above any of the others I have seen until now. Was just wondering if he was still working on it. :)

Lars on April 29, 2010 at 1:49 am

This is awesome. Great Job ! It is a good alternative to other solutions.

Schutzfolie on May 01, 2010 at 2:16 am

best source code i have visited ever.
but this is similar to the code which i used previously http://www.agriya.com

sathesh on May 04, 2010 at 6:36 am

Nice. Can be a good alternative to TinyMCE, its much heavy.

Usman on May 04, 2010 at 11:46 am

Thanks For The Useful Info

Cheers
Abaxis Software

varun jain on May 07, 2010 at 7:10 am

Perfect!!!

To save enough to do so:

1. <form onsubmit="instance.post();" action="">

2. and the creation of the object leave as follows:

var instance = new TINY.editor.edit('editor',{

Tks!!!

Jonas Ferreira on May 07, 2010 at 8:43 am

I just started using this last week and seem to have a hang of it. finally something with a easy learning curve.

ryan on May 07, 2010 at 5:10 pm

very Useful Info, thanks for sharing!

templatereactor on May 10, 2010 at 2:36 am

I like this tool very much.
When can we expect the option "paste from Word"?

André on May 11, 2010 at 2:36 am

Thanks, I like this design.

One thing I was curious about was how do I take out or disable the part that adds a background color?

Also I use this editor on a black background and between the text editor and the bottom of the "source" button is a black line. How do I fix this?

Goddard on May 12, 2010 at 1:37 am

Hello! Very nice work. Add please choose the text color. Thanks.

FORUS on May 12, 2010 at 2:27 am

Thanks for this excellent script! One thing I noticed is that if you give a TinyEditor instance a hyphenated name (like "new TINY.editor.edit('edi-tor',{"), toggling between wysiwyg and source doesn't work. Keep up the good work!

John on May 12, 2010 at 12:16 pm

It's a very useful editor when compared other text editors. light weight, quick load, easy customization.

Many thanks to Michael

Imran Khan on May 20, 2010 at 1:41 am

Hi,
It looks great, but one minor thing. Can you make the text field being focused again after clicking one of the mark up buttons?

Styxxy on May 20, 2010 at 4:15 am

This is a really great little script. Exactly what I have been looking for. Clean, simple, has everything you need and nothing more.

The ONLY thing that could possible make this any better is if it had some kind of image uploader. Then ckeditor and tinymce would see some real competition.

Thanks so much for this!

jeff on May 20, 2010 at 6:50 am

it doesn't seem to work on IE6, the iframe is not shown

paolo on May 22, 2010 at 4:57 am

I also seemed to have an issue with Firefox.
However this is a great tut overall. Thanks for sharing.

CodeMyConcept on May 24, 2010 at 2:47 pm

I need the font color change facility in this text editor dear admin please help me thanks anyway

Imran Khan on May 24, 2010 at 11:15 pm

TinyEditor a été choisi par le CMS 99KO ;)

Jonathan on May 28, 2010 at 5:43 am

The only problem I have with TinyMCE is that the default feature set is so broad that you spend a huge amount of time turning off most of the buttons you don't want to offer your end users.

Arizona Web Developers on May 28, 2010 at 11:41 am

great works guy!!!
but I have a problem with this tinyeditor, when I try to get the textarea value, the value is null, here is my code:

<?php
if( !isset($_POST['button']) ){
?>
<form name="form" method="post" action="<?php $_SERVER['PHP_SELF']?>">
<textarea id="input" name="textarea" style="width:400px; height:200px"></textarea>
<input type="submit" name="button" value="Submit" />
</form>
<?php
}else{
echo $_POST['textarea'];
}
?>
<script type="text/javascript">
new TINY.editor.edit('editor',{
id:'input',
width:584,
height:175,
cssclass:'te',
controlclass:'tecontrol',
rowclass:'teheader',
dividerclass:'tedivider',
controls:['bold','italic','underline','strikethrough','|','subscript','superscript','|',
'orderedlist','unorderedlist','|','outdent','indent','|','leftalign',
'centeralign','rightalign','blockjustify','|','unformat','|','undo','redo','n',
'font','size','style','|','image','hr','link','unlink','|','cut','copy','paste','print'],
footer:true,
fonts:['Verdana','Arial','Georgia','Trebuchet MS'],
xhtml:true,
cssfile:'style.css',
bodyid:'editor',
footerclass:'tefooter',
toggle:{text:'source',activetext:'wysiwyg',cssclass:'toggle'},
resize:{cssclass:'resize'}
});
</script>

the value of textarea is null, but when I delete this(id="input"), the textarea has a value,
anyone can help me please?

thanks
boo

boo on May 31, 2010 at 4:47 pm

Hello guys, how can I add font color picker/chooser into editor toolbox? Or what are the other control options? Help would be appreciated. Thank you.

rico on June 02, 2010 at 3:42 am

Everything is great, but I have one question.
I'm trying to control the event onChange in the textarea but it does not do anything.
Thanks for this simple and efective tool.

Oleg on June 02, 2010 at 3:52 pm

Thanks for sharing and posting. I know this would helped to everyone.

junemarkm on June 03, 2010 at 7:07 pm

great little script. unfortunately is not working if you call it in a modal. cannot use it :(

mike on June 05, 2010 at 3:43 pm

This is a great post showing a lightweight js editor. I will love to use it in my new websites that i create in kildare. i have a website development in kildare. my clients sometimes ask for such editors for posting messages. i will use it for them.

website development in kildare on June 06, 2010 at 12:21 am

It's very good.
I like this.
Thanks for share.
And I wrote something to introduce this project for my readers.
You can find the post about this in my website.
If something is wrong,pls figure it out.thanks.

123doing on June 06, 2010 at 7:43 pm

i have problem using the tiny editor
when it is in wysiwyg mode i dont get the value but as change it text mode i can get the value
i m using mozilla 3.6
please help

Thanks in advance

regards
Thomas

Thomas on June 07, 2010 at 6:39 am

i have problem using the tiny editor
when it is in wysiwyg mode i dont get the value but as change it text mode i can get the value
i m using mozilla 3.6

when i toggle the source to wysiwyg then it accept the value

please help

Thanks in advance

regards
Thomas

Thomas on June 07, 2010 at 6:59 am

I also tend to use TinyMCE when integrating WYSIWYG editors; but I'll give this one a try due to the small file-size and easy integration.

Thanks :)

Steve on June 07, 2010 at 8:00 am

Hi

Is there a way to have the editor look in a specific folder, looking for images to use?

So that I could write most of the path in the form, and then simply add the name of the image file?

Hope you know what I mean

//Carsten – Denmark

Carsten A Pedersen on June 08, 2010 at 3:23 am

Nice editor tool, I was really looking for an alternative lightweight WYSIWYG editor. I usualy use tinyMCE but that's quite heavy.

Ashish on June 11, 2010 at 7:22 am

Hi,
what with all generated dirty_moz attributes? Is it possible to clean it?

kolin on June 13, 2010 at 7:42 am

thanks it help me so much. i really thank full to you. Do you have this kind of editor example in jquery?

anditucker on June 14, 2010 at 12:25 am

this is the best editor I've found for XHTML free or otherwise. So Kudos to you for making such a great wysiwyg. I'm having trouble with the <embed> tag in this editor, embed doesn't seem to want to close itself. Other than that, wonderful and kudos.

Jesse on June 14, 2010 at 11:02 am

This looks interesting. Must be checked out, but thumbs up!

Michael Roberts on June 15, 2010 at 2:35 pm

Thank you very much, it will help everyone who are using and stuck in old editors.

Sandip Das on June 16, 2010 at 12:01 am

Hi,
Thanks for sharing this wonderful information.
Website designing and redesigning as per the UK accessibility conformance and W3C A / AA / AAA accessibility standards. Web Design Price starts at as low as £200.

Software Development India on June 16, 2010 at 12:48 am

As always your work is incredibly coded and has a very nice look to it. This is especially incredible, i am using it on my websites i build for clients. It's just the perfect simple easy to use html text editor. Very well done. Would like to see photo uploads though rather than just links, but can live without :) Did take me a little bit to figure out the problems i was having but read this and surely enough got the quick simple solution, the onsubmit="instance.post();".

Dylan on June 16, 2010 at 6:49 pm

Works wonderfully.

Thank you

Michael Minter on June 16, 2010 at 7:28 pm

I love it! Thank you for the script.
I use it for submitting WYSIWYG announcements (easy edit) from a webpage.

Fighterlegend on June 22, 2010 at 6:00 pm

Hi Michael,

I would like to ask something about your script in http://www.leigeber.com/2008/05/ajax-image-gallery-slideshow/. first af all thank you for your sharing. but i got some trouble because i am not so expert:( When i have more photos than 6 it does not work :( could you please help me about that.
thanks.

arzu on June 24, 2010 at 3:27 pm

Thank you,It's a great tool

jing ze yu on June 28, 2010 at 7:01 am

Thanks for sharing this stuff…..

Kim Jack on June 29, 2010 at 4:35 am

Thanks dear

Robert Stewart on June 29, 2010 at 4:36 am

At KTek IT <a href="http://ktek.ie">Website Design in Kildare</a> we use FCKEditor all of the time with our Drupal sites…its very flexible

KTek IT Solutions on July 01, 2010 at 9:53 am

At KTek IT Website Design in Kildare we use FCKEditor all of the time with our Drupal sites…its very flexible

Website Design in Kildare on July 01, 2010 at 9:54 am

Shi received a wonderful and beautiful hands

Amorous on July 05, 2010 at 5:34 pm

Hi Michael,

Thank you for this excellent text editor.
I tried to integrate Tinyeditor in a form that allows me to fill a data base, but unfortunately it did not work.

Any help would be greatly appreciated.

Thanks

Faouzi

Faouzi on July 07, 2010 at 5:45 am

Nice editor, will look into this.

Luke S on July 15, 2010 at 1:49 am

This is an awesome contribution.

Hope you will continue its development!

Web Design Mag Studio on July 15, 2010 at 2:50 am

Hola
El usuario que tenía problemas porque el textarea le mandaba vacío es porque en su codigo pone:
<textarea id="input" name="textarea" style="width:400px; height:200px">
El id debe ser igual que name.
<textarea id="input" name="input" style="width:400px; height:200px">

jhonny on July 16, 2010 at 12:13 am

This looks awesome, can't wait to give it a try

DESIGNvibe on July 17, 2010 at 4:30 am

Hi,
first of all thx for a such tiny wysiwyg editor:)
only problem is that i want the textarea to be focused after clicking at for example italic, bold, change font size e.t.c…

Another suggestion is that i want a color palette for the font color, that would be great.

When will the new version arrive?
B est regards

zilveer on July 18, 2010 at 10:20 am

Hi ,
Thank you for this excellent text editor. It looks very good and simple also.keep it up.

Manali on July 19, 2010 at 6:34 am

So I found a nasty regex bug that deals with multiple strong tags. i.e.:

<strong>a</strong>
<strong>b</strong>

When you switch between code and wysiwyg, it ends up grabbing and replacing the very first <strong> and the very last </strong> and not handling the ones in between.

For the sake of time, I've forked the project on github and posted a fix:
http://github.com/c0/tinyeditor.js/

The fix:
http://github.com/c0/tinyeditor.js/commit/6006c45df301f1bf45c490b2cf09e983fd697c83

Caleb on July 20, 2010 at 10:59 am

form is not working in tiny editor using php code

arun on July 21, 2010 at 11:00 pm

Very Impressive work.

Seo agency India on July 22, 2010 at 6:12 am

I preffer fck editor or tinyMCE

Neo Medya on July 29, 2010 at 7:30 pm

Has anyone any advice, source code to how I could at in image uploading in php. I've messed around with some php & used ajax to make an uploader but I cant seem to get images into the textarea nicely. numerous problems really. Anyone had much joy?

Jonathan Goodman on July 30, 2010 at 5:26 pm

Just a suggestion: remove the "px" from the js file. They make it impossible to set the width to a "%". Not only would it make the js files smaller by a couple of bytes, it makes it more flexible to users.

jv on August 04, 2010 at 9:12 am

Great share. I'd like to see if you could change the font color but I think this is an excellent editor.

Justin D. on August 05, 2010 at 9:19 pm

Wonderful Work, Very impressive. Thanks for sharing this Editor.

website design company delhi on August 05, 2010 at 11:45 pm

I have a form with 4 fields. The editor works great but when i submit the form, the content of the editor is always empty. I added instance.post() (tried editor.post()) and wrote in the script: var instance = new TINY.editor.edit('editor',{id:'input',…

what's wrong?
could it work in a form with more fields than the textarea?
Thank You

Webpaul on August 06, 2010 at 3:11 am

Hola tengo un problema,
Cuando envio el "textarea" en vista "wysiwyg" la variable llega vacia. Pero Si lo envio en vista "source" entonces si llega la variable. Que debo hacer para que llegue la variable?
Programo en php…

In english (I'll try)

Hi I have a problem,
When I send the "textarea" in sight "wysiwyg" variable (the text) comes empty. But if you send in view "source" variable (the text) goes well. What should I do to get the variable in view "wysiwyg"?
programming in php

Isaac on August 06, 2010 at 11:14 pm

por cierto, el codigo lo tengo asi:
by the way, the code is:

<textarea id="input" name="input" style="width:500px; height:350px;">

Isaac on August 06, 2010 at 11:17 pm

asdasd

a on August 07, 2010 at 9:03 am

Really a great information, Thanks for sharing.

Web Development Bangalore on August 09, 2010 at 1:48 am

Really great information,thanks for shared

Asha@Wedding Forum on August 11, 2010 at 12:46 am

Hi Michael,
Please help … I need to when you click on Enter in the TinyEditor insertion <br /> instead <p>

Armen on August 12, 2010 at 5:34 am

Check out my blog at hotgrades dt com and make sure to leave a comment. It has discussions on Web Development, Web Design and other cool software topics.

Vladimir on August 13, 2010 at 10:56 am

Look very nice! Coming a table and icons(smilies) buttons too? :)

Rei on August 16, 2010 at 4:19 am

Can you add the function of

add color ?

please

Zern on August 16, 2010 at 11:08 pm

Excelente herramienta, pero cuando trato de grabar en mi B.Datos no lo guarda, pero si antes de guardarlo le doy click en <source> graba perfectamente.

Alguien le sucede lo mismo..??

Helthon on August 19, 2010 at 1:36 pm

Thanks for this very informative post! This is a very useful tool that we can be employ in web designing.

santa barbara web design on August 21, 2010 at 11:10 pm

Hi,

I am using this with pleasure! Only one big keeps coming up. When I make a word bold, the output (on the landing page) makes it like: (strong)the word(/span), offcourse in regular HTML tags, not with ( )…

Is this only with my firefox 3.6.8 or have more people this problem?

You can mail me for more info if you need it…

Thnx,
Bas

Bas on August 22, 2010 at 3:20 am

By the way, it only happens if I also add style (for example 'italic') to another word somewehre further along in the text.

Bas on August 22, 2010 at 3:29 am

great job. thanks!

Cenk SARI on August 22, 2010 at 7:17 am

Hi. This is a grea liteweight script. I personally love it, but i have one problem. I dont want to keep adding id's to every text area. How can i set it for every textarea without using id's something like TinyMCE?

Victor on August 25, 2010 at 3:33 am

I have heard great things about TinyEditor, and will implement this into one of my next projects, Thanks

Craig on August 25, 2010 at 12:00 pm

Thanks for sharing this great resource. LT

Lisa Thomason on August 25, 2010 at 12:03 pm

is a good editor!

Alex on August 27, 2010 at 6:26 am

Trackbacks

Comments are closed at this time.