Insert / Update with the RTE editor

This tutorial will desribe how to build an Insert / Update page using the RTE editor
  Contents  
  Installing and options Next

First if you're not comfortable with installing extensions follow the tutorial on how to install the editor.

Ok now thats done, we have the editor embedded on a blank page, in this case I am using ASP but use PHP or whatever you want:

There are a couple of options you can set on the editor specified by the line: richedit.options, these are as follows:

Option Options Default Description
       
history yes / no yes This option is used to turn the undo / redo feature on or off.
source yes / no yes This option allows you to turn the ability to let the user edit the source code of the document in the editor on or off.
styleBar yes / no yes This option allows the style tool bar to be enabled/disabled. The style toolbar comprises the Style, Font, Size and Colour tools.
style yes / no yes This option allows the style selector to be enabled/disabled.
font yes / no yes This option allows the font selector to be enabled/disabled.
fontsize yes / no yes This option allows the font size selector to be enabled/disabled.
colour yes / no yes This option allows the colour selector(s) to be enabled/disabled.

All these properties are enabled by default and you must specify if you want to turn them off, seperated by a semicolon, for example I want to allow my users to edit the document but NOT be able to specify the FONT or EDIT THE HTML, I would modify the richedit.options line to read as follows.

<object id="richedit" data="RTE_files/richedit.html" width="100%" height="100%" type="text/x-scriptlet" "viewastext">
</object>
<form id="theForm" name="theForm">
<textarea name="text" style="display:none" rows="1" cols="20"></textarea>
<input name="forename" type="text" id="forename" />
<input name="surname" type="text" id="Surname" />
</form>
<script language="JavaScript" type="text/JavaScript" event="onload" for="window">

richedit.options="font=no;source=no";

richedit.docHtml = theForm.text.innerText;
</script>

This will disable the features I dont want.

now thats done lets move on to putting extra fields into the rte editor.

  Contents  
  Installing and options Next

 

Bill Chalmers

Bill ChalmersStarted doing sites in Frontpage about 3 years ago, progressed to ASP, Linux/Mysql, and PHP/MYSQL, currently learning LDAP, XML, XHTML, ASP.net, learning more about css, worked in Hammersmith Hospital for 8 years, Developed

www.hammersmithresearch.com
www.cafenetix.com
www.hammersmithcafe.org

Also developed the Trusts Intranet site with lots of php/asp applications built in, content management, enjoy getting paid for mucking about with stuff I do as a hobby.

See All Postings From Bill Chalmers >>

Comments

Thank You !

July 19, 2002 by Doug R

Nice job Bill, thank you! How about another one? Mybe in combination with file upload.

Dot

RE: Thank You !

July 19, 2002 by Bill Chalmers
Thanks for the compliment, at present I am trying to find a good, free, asp only upload script, php is easily doable, but I want to integrate both asp and php upload into the editor, currently I am having no luck finding an asp script to do the upload.

Question about other fields

July 30, 2002 by Tolu Ayoola
I was just wondering if it is possible to use other form fields such as radio buttons, check boxes, and file fields in the RTE editor. By the way, this extension is awesome. thanks

RE: Question about other fields

July 30, 2002 by Bill Chalmers
That is what I am working on currently, adding different types of fields to the editor, I will update the extension when I have developed this, you can of course use different types outside of the editor, just not embedded currently.
See all 17 Comments

You must me logged in to write a comment.