I am using CKEditor (jquery) in one of my apps and when the page is submitted, the HTML code from the editor is inserted into my SQL server database. the field its being inserted into is a varchar(8000) and sometimes when users paste a bunch of code from a word document into CKEditor, they end up going over the 8000 characters and get an error when i try to do the insert.
i am wondering if there is a way to have the equivalent of a maxlength attribute on a CKeditor instance.
i am wondering if there is a way to have the equivalent of a maxlength attribute on a CKeditor instance.
Re: how to track field length
I tried doing some javascript to only allow the form to submit if the length of the field is less than 8000 characters ($("#myContent").val().length < 8000)
and it kind of works but the value i get is usually off by anywhere from 10 - 50 characters so sometimes it submits and the data still gets truncated a bit when being submitted to the database on the processing page.
there must be some kind of accurate way to handle this...
anyone have any ideas?