I'm using CKEditor 3.0 RC.
I integrated it in a web page and a client-side HTA Application.
The editor loads properly in both.
When submitting the form that contains the CKEditor, I use a javascript onSubmit() event to capture the value of the textarea.
However, the value of the textarea is not altered from its initial page load value. CKEditor does not pass the value of the editor into the actual textarea the editor has replaced.
Therefore, the edited content is not accessible to my onSubmit() event for use as a string.
The only value passed is the initial value when the page had loaded.
I am using textfileobject to capture the value of the editor textarea and write it to a file client-side.
The issue here is that CKEditor does not pass the string value of the editor content to the textarea.
How can I resolve this?
THE CODE OF THE ENTIRE PAGE IS BELOW:
<HTML>
<HEAD>
<TITLE>ADD NEW WEB PAGE</TITLE>
<LINK TYPE = "TEXT/CSS" REL = "STYLESHEET" HREF = "MAINSTYLE.CSS"></LINK>
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<SCRIPT LANGUAGE = "JavaScript">
function addpage()
{
var a, fso, filename;
var WRITEPAGETITLE, WRITEPAGEDESCRIPTION, WRITEPAGEBODYTEXT, WRITEPAGESOURCEURL;
WRITEPAGETITLE=document.ADDNEWPAGE.NEWPAGETITLE.value;
WRITEPAGEDESCRIPTION=document.ADDNEWPAGE.DESCRIPTION.value;
WRITEPAGEBODYTEXT=document.ADDNEWPAGE.MAINBODYTEXT.value;
WRITEPAGESOURCEURL=document.ADDNEWPAGE.SOURCEURL.value;
fso = new ActiveXObject("Scripting.FileSystemObject") ;
filename = "TESTDELETEME.html" ;
a = fso.CreateTextFile(filename,2) ;
a.WriteLine(WRITEPAGETITLE) ;
a.WriteLine(WRITEPAGEDESCRIPTION) ;
a.WriteLine(WRITEPAGEBODYTEXT) ;
a.WriteLine(WRITEPAGESOURCEURL) ;
a.Close()
window.alert("PAGE ADDED!");
}
</SCRIPT>
</HEAD>
<BODY>
<form NAME="ADDNEWPAGE" onSubmit="return false;">
<TABLE>
<TR>
<TD>
<INPUT CLASS="input2" TYPE="TEXT" NAME="NEWPAGETITLE"></INPUT>
</TD>
<TD>TITLE
</TD>
</TR>
<TR>
<TD>
<TEXTAREA NAME="DESCRIPTION"></TEXTAREA>
</TD>
<TD>
INTRO / DESCRIPTION
</TD>
</TR>
<TR>
<TD>
<textarea class="ckeditor" id = "MAINBODYTEXT" name="MAINBODYTEXT">ADD MAIN BODY OF ARTICLE HERE</textarea>
<!-- TURN BODY TEXTAREA INTO HTMLAREA -->
</TD>
<TD>
MAIN TEXT
</TD>
</TR>
<TR>
<TD>
<INPUT CLASS="input2" TYPE="TEXT" NAME="SOURCEURL" STYLE="input2"></INPUT>
</TD>
<TD>
SOURCE URL
</TD>
</TR>
<TR>
<TD>
<INPUT TYPE="submit" VALUE="ADD PAGE" onMouseDown="submit();" onMouseUp=addpage();>
<INPUT TYPE="BUTTON" VALUE="CANCEL">
</TD>
</TR>
</TABLE>
</form>
<SCRIPT LANGUAGE = "JavaScript">
window.resizeTo(1000,650);
window.resizeTo(1000,650);
</SCRIPT>
<!-- WRITE PAGE ON SUBMIT, CALL FUNCTIONS -->
</BODY>
</HTML>
I integrated it in a web page and a client-side HTA Application.
The editor loads properly in both.
When submitting the form that contains the CKEditor, I use a javascript onSubmit() event to capture the value of the textarea.
However, the value of the textarea is not altered from its initial page load value. CKEditor does not pass the value of the editor into the actual textarea the editor has replaced.
Therefore, the edited content is not accessible to my onSubmit() event for use as a string.
The only value passed is the initial value when the page had loaded.
I am using textfileobject to capture the value of the editor textarea and write it to a file client-side.
The issue here is that CKEditor does not pass the string value of the editor content to the textarea.
How can I resolve this?
THE CODE OF THE ENTIRE PAGE IS BELOW:
<HTML>
<HEAD>
<TITLE>ADD NEW WEB PAGE</TITLE>
<LINK TYPE = "TEXT/CSS" REL = "STYLESHEET" HREF = "MAINSTYLE.CSS"></LINK>
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<SCRIPT LANGUAGE = "JavaScript">
function addpage()
{
var a, fso, filename;
var WRITEPAGETITLE, WRITEPAGEDESCRIPTION, WRITEPAGEBODYTEXT, WRITEPAGESOURCEURL;
WRITEPAGETITLE=document.ADDNEWPAGE.NEWPAGETITLE.value;
WRITEPAGEDESCRIPTION=document.ADDNEWPAGE.DESCRIPTION.value;
WRITEPAGEBODYTEXT=document.ADDNEWPAGE.MAINBODYTEXT.value;
WRITEPAGESOURCEURL=document.ADDNEWPAGE.SOURCEURL.value;
fso = new ActiveXObject("Scripting.FileSystemObject") ;
filename = "TESTDELETEME.html" ;
a = fso.CreateTextFile(filename,2) ;
a.WriteLine(WRITEPAGETITLE) ;
a.WriteLine(WRITEPAGEDESCRIPTION) ;
a.WriteLine(WRITEPAGEBODYTEXT) ;
a.WriteLine(WRITEPAGESOURCEURL) ;
a.Close()
window.alert("PAGE ADDED!");
}
</SCRIPT>
</HEAD>
<BODY>
<form NAME="ADDNEWPAGE" onSubmit="return false;">
<TABLE>
<TR>
<TD>
<INPUT CLASS="input2" TYPE="TEXT" NAME="NEWPAGETITLE"></INPUT>
</TD>
<TD>TITLE
</TD>
</TR>
<TR>
<TD>
<TEXTAREA NAME="DESCRIPTION"></TEXTAREA>
</TD>
<TD>
INTRO / DESCRIPTION
</TD>
</TR>
<TR>
<TD>
<textarea class="ckeditor" id = "MAINBODYTEXT" name="MAINBODYTEXT">ADD MAIN BODY OF ARTICLE HERE</textarea>
<!-- TURN BODY TEXTAREA INTO HTMLAREA -->
</TD>
<TD>
MAIN TEXT
</TD>
</TR>
<TR>
<TD>
<INPUT CLASS="input2" TYPE="TEXT" NAME="SOURCEURL" STYLE="input2"></INPUT>
</TD>
<TD>
SOURCE URL
</TD>
</TR>
<TR>
<TD>
<INPUT TYPE="submit" VALUE="ADD PAGE" onMouseDown="submit();" onMouseUp=addpage();>
<INPUT TYPE="BUTTON" VALUE="CANCEL">
</TD>
</TR>
</TABLE>
</form>
<SCRIPT LANGUAGE = "JavaScript">
window.resizeTo(1000,650);
window.resizeTo(1000,650);
</SCRIPT>
<!-- WRITE PAGE ON SUBMIT, CALL FUNCTIONS -->
</BODY>
</HTML>
Re: Cannot Access Textarea Value
<INPUT TYPE="submit" VALUE="ADD PAGE" onMouseDown="submit();" onMouseUp=addpage();>
your onMouseDown is set correctly with quotas but you onMouseUp doesn't.
Please change it to onMouseUp="addpage()"
Maybe it woll work then....