I liked your article on HTML Area's new editor. It helped me a lot to get it
up and running. However, have you ever tried putting 2 areas on one form. It
seems to work in a very odd way. That is, simply displaying the 2 editors with
all editor buttons it pretty simple with the script below:
function initEditor() {
if (!_edit_mode) return;
var editor1 = new HTMLArea("Body1");
editor1.registerPlugin(TableOperations);
editor1.generate();
var editor2 = new HTMLArea("Body2");
editor2.registerPlugin(TableOperations);
setTimeout(function() {
editor2.generate();
}, 1500);
}
But when we try to save both editor's data, only the last one gets saved. Even
without the (wqsSimple) agent, which I modified to work on both body fields, in
your database.
Even more odd is that when you enter both editor's data and then leave the
title field blank so that the script below results in an alert first, then,
when entering the title after receiving the alert and submitting again, will
result in saving both editor's data.
function doSubmit(){
var objForm = document.forms[0];
if (objForm.Title.value==""){
alert('Please enter a title for this document')
objForm.Title.focus();
return false;
}
objForm.submit();
}
Weird, woudn't you say! You should try it yourself. I read about many similar
problems on HTML Area's forum, but wondered why this alert msg would solve the
problem as mentioned above since most of the time this alert won't appear and
thus the data from the first editor won't be saved.
So in short, when leaving title blank the first time, the data from the fist
editor will get saved as well.
Any clue to this mistery is appreciated, since I would like to have this up and
running by the end of this week.
Hi,
I liked your article on HTML Area's new editor. It helped me a lot to get it up and running. However, have you ever tried putting 2 areas on one form. It seems to work in a very odd way. That is, simply displaying the 2 editors with all editor buttons it pretty simple with the script below:
function initEditor() { if (!_edit_mode) return; var editor1 = new HTMLArea("Body1"); editor1.registerPlugin(TableOperations); editor1.generate();
var editor2 = new HTMLArea("Body2"); editor2.registerPlugin(TableOperations); setTimeout(function() { editor2.generate(); }, 1500); }
But when we try to save both editor's data, only the last one gets saved. Even without the (wqsSimple) agent, which I modified to work on both body fields, in your database.
Even more odd is that when you enter both editor's data and then leave the title field blank so that the script below results in an alert first, then, when entering the title after receiving the alert and submitting again, will result in saving both editor's data.
function doSubmit(){
var objForm = document.forms[0];
if (objForm.Title.value==""){ alert('Please enter a title for this document') objForm.Title.focus(); return false; } objForm.submit(); }
Weird, woudn't you say! You should try it yourself. I read about many similar problems on HTML Area's forum, but wondered why this alert msg would solve the problem as mentioned above since most of the time this alert won't appear and thus the data from the first editor won't be saved.
So in short, when leaving title blank the first time, the data from the fist editor will get saved as well.
Any clue to this mistery is appreciated, since I would like to have this up and running by the end of this week.
Regards, Jimmy