http://www.fckeditor.net/forums/viewtopic.php?f=6&t=7120&p=18975&hilit=validation#p18975
if (typeof(FCKeditorAPI)!=='undefined') {
alert("API Not Defined");
} else {
alert("All good")
}
<SCRIPT language=JavaScript type=text/JavaScript>
// global function caller to validate form
function validForm(){
alert ("hello world");
if (typeof(FCKeditorAPI)!=='undefined') {
alert("API Not Defined");
} else {
alert("All good")
}
if (
radChk ('adminForm','changeModule','Please state the changes to the module you would like to make.')&&
hasVal ('adminForm','changeDefDoc','Please state what impact the changes is likely to have on the definitive document.')&&
hasVal ('adminForm','changeDefDoc','Please say something!')
)
{ return true;}
else
{return false;}
}
</SCRIPT>
<form id="adminForm" name="adminForm" method="post" action="minorModCat1.asp?step=step4" onsubmit="return validForm()">
...
<td colspan="4">
<%
'sBasePath = "/fds/FCKEditor/"
'Dim oFCKeditor
'Set oFCKeditor = New FCKeditor
'oFCKeditor.BasePath = sBasePath
'oFCKeditor.Value = changeDefDoc
'oFCKeditor.Height = 200
'oFCKeditor.ToolbarSet = "Basic"
'oFCKeditor.Config("SkinPath") = "/fds/FCKeditor/editor/skins/office2003/"
'oFCKeditor.Create "changeDefDoc"
%>
</td>
</form>
<script type="text/javascript" src="/fds/FCKEditor/fckeditor.js"></script>
<script type="text/javascript">
window.onload = function()
{
var oFCKeditor = new FCKeditor( 'MyTextarea' ) ;
oFCKeditor.BasePath = "/fds/FCKeditor/" ;
oFCKeditor.ReplaceTextarea() ;
FCKeditor_OnComplete()
}
function FCKeditor_OnComplete()
{
}
</script>
<script type="text/javascript" src="javascript/valid.js"></script>
<SCRIPT language=JavaScript type=text/JavaScript>
// global function caller to validate form
function validForm(){
alert ("hello world");
if (typeof(FCKeditorAPI)!=='undefined') {
alert("API Not Defined");
} else {
alert("All good")
}
if (
radChk ('adminForm','changeModule','Please state the changes to the module you would like to make.')&&
hasVal ('adminForm','changeDefDoc','Please state what impact the changes is likely to have on the definitive document.')&&
hasVal ('adminForm','myTextarea','Please say something!')
)
{ return true;}
else
{return false;}
}
</SCRIPT>
<form id="adminForm" name="adminForm" method="post" action="minorModCat1.asp?step=step4" onsubmit="return validForm()">
...
<td colspan="4"><textarea id="MyTextarea" name="MyTextarea"></textarea></td>
...
</form>

Re: form validation and FCK
In case you still have the problem mentioned. Try this. On the page hosting the fckeditor add this javascript function.
function FCKeditor_OnComplete(editorInstance)
{
alert( editorInstance.Name );
}
after that you will be able to access the editors contents using the javascript API.
var oEditor = FCKeditorAPI.GetInstance(instancename);
var contents = oEditor.GetXHTML(true);
alert(contents);
Hope this helps.
Re: form validation and FCK
I must be missing exactly where to place the code.
Re: form validation and FCK
SO ,
var oEditor = FCKeditorAPI.GetInstance('keywords');// note keywords is the name of the new FCKeditor and has to be quoted
var contents = oEditor.GetXHTML(true);
the value of contents can then be validated as you normally would in any JS function.
Re: form validation and FCK
if ( typeof ( FCKeditorAPI ) == 'defined' ) { // call if defined ##
var oEditor = FCKeditorAPI.GetInstance('instancename');
var instancename = oEditor.GetXHTML(oEditor.FormatOutput);
}