Has anyone ever tried to validate an FCKeditor textfield before submitting a form?
I need to check the word count of a document in an FCK field before its submitted incase it exceeds the number of characters that will fit into a PDF template.
I tried just getting the value of the element id into a variable with Javascript and getting the length of the string but the value always seems to be empty.
Code: Select all
var mystring = document.getElementById('FCKeditor1').value;
var textlen = mystring.length;
I was originally checking the length serverside after the form had been submitted but the trouble is that if the length exceeds the maximum characters allowed, when the user clicks the back button or my back link, the form is completely empty and they're not going to be pleased at having to type the whole article again rather than just delete a few sentences.