When a page with obout HTML Editor component is loaded, client-side HTML Editor object is available.
You can get it:
var editorObject = oboutGetEditor("editor");
"editor" here is the obout HTML Editor component Id you used in your ASPX page.
Also you can get it using Client ID:
var editorObject = oboutGetEditorByClientId("ctl0_splitter1_ctl0_editor");
"ctl0_splitter1_ctl0_editor" here is the obout HTML Editor component's client ID.
User can define a function that will be executed on HTML Editor load. This function should have name EditorOnLoad.
function EditorOnLoad(editor)
{
editor.chMode("text"); // set initial HTML text mode
}
User can define a function that will be executed before HTML Editor activation. This function should have name EditorBeforeActivate.
function EditorBeforeActivate(editor)
{
editor.defaultStyles += " body { color: blue;}"; // change default color for content
}
User can also define a function for Submit validation. This function should have name EditorOnSubmit
and return true on success or false on fail. HTML Editor's content will not be submited if this function returns false.
function EditorOnSubmit(editor)
{
if(editor.getContent().length > 1000)
{
setTimeout(function(){alert("Content's length is more than 1000 characters!");},0);
return false;
}
return true;
}
Another example of EditorOnSubmit function use.
It calls Spell Checker, and submits if OK was clicked.
function EditorOnSubmit(editor)
{
function checkResult(ok)
{
if(ok) editor.submit();
}
editor.spellCheck(checkResult);
return false;
}