How to get TinyMCE and Jquery validate to work together?
        Posted  
        
            by chobo2
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by chobo2
        
        
        
        Published on 2010-05-29T05:48:39Z
        Indexed on 
            2010/05/29
            5:52 UTC
        
        
        Read the original article
        Hit count: 393
        
Hi
I am using jquery validate and the jquery version of tinymce.
I found this piece of code that makes tinymce to validate itself every time something changes in it.
Hi
I am using the jquery validate with my jquery tinymce so I have this in my code
    // update validation status on change
    onchange_callback: function (editor)
    {
        tinyMCE.triggerSave();
        $("#" + editor.id).valid();
    },
This works however there is one problem. If a user copies something from word it brings all that junk styling with it what is usually over 50,000 characters. This is way over my amount of characters a user is allowed to type in.
So my jquery validation method goes off telling me that they went over the limit. In the mean time though tinymce has cleaned up that mess and it could be possible now the user has not gone over the limit.
Yet the message is still there.
So is there a better function call I can put this in? Maybe tell tinymce to delay the valid when a paste is happening, or maybe a different callback?
Anyone got any ideas?
© Stack Overflow or respective owner