Hello, all.
Got my last issue resolved after hours of searching, now I have a new one.
I am attempting to use client-side JavaScript for form validation, and am not quite sure how to get JavaScript to see the value contained within the FCKeditor plugin. I've found several different "solutions", but none are working. Here's what I've got, so far:
In the form, I'm using the JavaScript API to load the editor plugin ("#thisContent#" is a Cold Fusion variable):
The form submit button calls a function called "checkData()":
I get the error message "'value.length' is null or not an object". If it's an easy fix, please forgive me as I'm pretty wiped, right now.
What is the fix for this?
Thanks,
CF_Guy
Got my last issue resolved after hours of searching, now I have a new one.
I am attempting to use client-side JavaScript for form validation, and am not quite sure how to get JavaScript to see the value contained within the FCKeditor plugin. I've found several different "solutions", but none are working. Here's what I've got, so far:
In the form, I'm using the JavaScript API to load the editor plugin ("#thisContent#" is a Cold Fusion variable):
<script type="text/javascript"> var oFCKeditor = new FCKeditor( 'ArticleBody' ) ; oFCKeditor.Value = "#thisContent#"; oFCKeditor.Width = "780"; oFCKeditor.Height = "450"; oFCKeditor.Create() ; </script>
The form submit button calls a function called "checkData()":
function checkData() { var oEditor = FCKeditorAPI.GetInstance('ArticleBody') ; var jsArticleBody = oEditor.GetXHTML(true) ; warn = ""; df = document.AddForm; if (df.ArticleAuthor.selectedIndex == 0) { warn += "Please choose an Author for this Article.\n"; } if (df.ArticleCategory.selectedIndex == 0) { warn += "Please choose a Category for this Article.\n"; } if (df.ArticleTitle.value == "") { warn += "Please enter a Title for this Article.\n"; } if (df.ArticleStart.value == "") { warn += "Please enter a Start Date for this Article to display.\n"; } if (df.ArticleEnd.value == "") { warn += "Please enter an End Date for this Article to stop displaying.\n"; } if (jsArticleBody.value.length == 0) { warn += "Please enter a Body for this Article.\n"; } document.AddForm.action="#thisaction#"; if (warn == "") { document.AddForm.submit(); } else { alert('* * * PLEASE MAKE THE FOLLOWING CORRECTIONS * * *\n_______________________________________________\n\n' + warn); return false; } }
I get the error message "'value.length' is null or not an object". If it's an easy fix, please forgive me as I'm pretty wiped, right now.
What is the fix for this?
Thanks,
CF_Guy
Re: FCKeditor with JavaScript form validation issue, Please help
Re: FCKeditor with JavaScript form validation issue, Please help
Re: FCKeditor with JavaScript form validation issue, Please help
I knew it was something simple and I was just too wiped to see it.
Thanks,
CF_Guy