HTML Rich Text Area`s rich programming interface Interfacing with databases
Home > Products > HTML Rich Text Area > Programming

Programming

The HTML Rich Text Area provides a programming interface that can be called through javascript. These functions include setting the HTML Rich Text Area to read-only after the page has been drawn, changing the HTML, changing the height of the HTML Rich Text, returning the HTML or responding to user initiated events.  Examples of these functions are demonstrated at the bottom of the page.

These functions are particularly useful in database driven web applications. Depending on a user's permissions the may not be allowed to change information or you may want to validate their input before they click Save.

FunctionDescription
Draw Displays the HTML Rich Text Area

DrawReadOnly Displays the HTML Rich Text Area in a read only format. Call [HTMLRTAObject].MakeReadOnly(false) from javascript to make it read/write.

MakeReadOnly(blnReadOnly) MakeReadOnly makes the HTML Rich Text Area read only if the parameter is set to true and read-write if it is set to false. This is useful for web pages that are part of some database driven web application in which the user may not have permission to edit the information.

GetHTML GetHTML returns the HTML that is currently being edited in the HTML Rich Text Area.

SetHTML(strHTML) SetHTML sets the HTML at run time.

InsertHTML(strHTML) Inserts the HTML at the current insertion point

SetHeight(intHeightPx) Modifies the height of the HTML Rich Text.

WrapHTMLParent(strOpenTag, strCloseTag) Wraps the selected text's parent with the specified opening and closing tags.

WrapHTMLSelection(strOpenTag, strCloseTag) Wraps the selected text with the specified opening and closing tags.

EVENTCATCHER Defines the function to receive a call back whenever the text changes in the HTML Rich Text Area.

EVENTHTMLRTALOADED Defines the function to receive a call back when the HTML Rich Text Area is loaded.

EVENTONKEYUP Defines the function to receive a call back a key up event is raised.

EVENTONKEYDOWN Defines the function to receive a call back a key down event is raised.

EVENTFOCUSIN Defines the function to receive a call back when the HTML Rich Text Area receives the focus.

EVENTFOCUSOUT Defines the function to receive a call back when the HTML Rich Text Area loses the focus.

This results in the following:



Set the height of the first HTML Rich Text Area:

Download

HTML Rich Text Area DownloadHTML Rich Text Area download

Copyright tcp/IQ is part of the Sigma Solutions group Internet protocol analysis (c) Copyright 2009.  Validate the page against W3C XHTML 1.0 specification at http://validator.w3.org