I have some javascript code that loops through the elements of a form. In this code I need to check the contents of a CKeditor-replaced textarea. Code that works with FCKeditor is:
for (var i = 0; i < theForm.length; i++) {
var e = theForm.elements[i];
if (e.type == "hidden") {
// this is a CK editor field
var FC_editor = FCKeditorAPI.GetInstance(e.name);
if (isBlank(FC_editor.GetHTML())) {
empty_fields += "\n " + e.ExName;
}
continue;
}
}
I tried to substitute checking for a textbox and:
if (isBlank(CKEDITOR.instances.e.name.getData())) {
but that errors on e.name. What is the proper syntax to do this reference?
for (var i = 0; i < theForm.length; i++) {
var e = theForm.elements[i];
if (e.type == "hidden") {
// this is a CK editor field
var FC_editor = FCKeditorAPI.GetInstance(e.name);
if (isBlank(FC_editor.GetHTML())) {
empty_fields += "\n " + e.ExName;
}
continue;
}
}
I tried to substitute checking for a textbox and:
if (isBlank(CKEDITOR.instances.e.name.getData())) {
but that errors on e.name. What is the proper syntax to do this reference?