Richtextarea

What's this?

Richtextarea is a jQuery plugin to convert an html TEXTAREA tag in html editing.

Richtextarea requires the latest version of jQuery.

Richtextarea is conform to jQuery UI.

Demo

Using standard

By default, the widget richtextarea displays the editor with the toolbar.

Sample Code

<textarea name="test" id="edit1" cols="40" rows="5">
Test
</textarea>
<script type="text/javascript">
  $("#edit1").richtextarea();
</script>

Using external button

It is possible to create editings buttons in external of editor.

Sample Code

<input type="button" id="bold" value="Bold" />
<input type="button" id="italic" value="ialic" />
<input type="button" id="gethtml" value="gethtml" />
<textarea name="test" id="edit2" cols="40" rows="5">
Test
</textarea>

<script type="text/javascript">
  $("#edit2").richtextarea({ toolbar: false });
  $("#bold").click(function() { $("#edit2").richtextarea('bold'); });
  $("#italic").click(function() { $("#edit2").richtextarea('italic'); });
  $("#gethtml").click(function() { val = $("#edit2").richtextarea('gethtml'); alert(val); }); </script>

Documentation

At initialization richtextarea, an edit box is initialized with DIV. The tag TEXTAREA is hidden. Any changes made in the DIV are copied in the TEXTAREA.

A toolbar is automatically added to the editor. It is possible to don't display the toolbar with the option 'toolbar'.

In your website, it is necessary to add the following call:

<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="jquery.richtextarea.js"></script>

<link rel="stylesheet" type="text/css" href="jquery-ui-1.7.2.custom.css" />
<link rel="stylesheet" type="text/css" href="richtextarea.css" />

toolbar [boolean]

Hide the toolbar.

onChange [function]

Execute a function when changing the value of the textarea.

navigationPath [boolean]

Displays the navigation bar of the cursor in the text.

italic

Applies the italic style on selection.

bold

Applies bold style on selection.

gethtml

returns the current value of TEXTAREA.

release

  • 1.0.1

    init code

© 2009 Daniel Thalmann