ValidateThis and CKEditor
I'm just working on a site that uses the CKEditor WYSIWYG editor and ValidateThis and wanted to make the content required. In the past I've done something like I showed in my post Validate CKEditor content length. The problem is that the client side validation that ValidateThis creates, validates against the hidden formfield that CKEditor uses and not the actual contents of the editor. I considered several possible options, including writing a custom client side validation for ValidateThis, however, in the end I went for this simple solution:
$('form').bind('submit', function(){
if (typeof CKEDITOR != "undefined"){
for (instance in CKEDITOR.instances){
CKEDITOR.instances[instance].updateElement();
}
}
});
- Posted in:
- ValidateThis


Comment by Jim Priest – October 31, 2011
Comment by John Whish – November 01, 2011