Please note that this tool has now been replaced by RTWedit.

IEWedit example

This page provides a simple demonstration of IEWedit, the JavaScript WYSIWYG editor for IE. If you have Netscape, then you need to use NetWedit, which actually has the same API.

Below there are two Text boxes where you can start typing in the your text. Alternatively you can copy and paste into the boxes. When you've entered the text, click on an [Edit] button to open an Preview window, which shows how your text will appear in a browser. You can format the text by selecting regions in the edit window and clicking on the buttons underneath the text box. You can also add and delete text.

Changes will be reflected immediately: you will see HTML code inserted automatically in the respective text box and clicking on the edit window will update the resulting display. (The Text box shows the HTML Source view).

Text



Explanation

If you look at the source code you will see at the top, between <HEAD> tags a reference to the include script that contains the IEWedit code:

  <script language="JavaScript1.2" src="iewedit0_2.js">
  </script>

The source is here.

The script can then be used by calling a function within forms, and specifying a few parameters, as in the following lines:

  <INPUT onclick="preview('form1','box')" type=button value="Edit 1"> 
  <INPUT type="hidden" name="backupbox">
  <INPUT type="hidden" name="prevbox" value="">

This page contains a single form with two text area fields. Each field has associated with it a pop-up window which is created when a user clicks on the [Edit 1] button to start a call to the preview function inside the library file, iewedit0_2.js.

The functions require some parameters in order to pass data to and from the edit window and this form. First of all, two parameters are needed to distinguish the particular form and the particular field - form1 and box respectively. The hidden field named backupbox is used for the UNDO function and stores a copy of the contents of the text area box before a format button is pressed. It needs to be named: backup. Similarly, the prevbox field is used internally, this time to store information about the way carriage returns are handled.


Related script for Netscape: NetWedit