We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15083
    • 697 Posts
    Hi there,

    I have a requirement to validate RTE's as blank or not.
    I have backend inputoptions working, and indeed im alsmost there.

    Problem, im checking my validation against the id of the text area the tv creates, ie "tv14" etc.
    If however you use the html code view and choose UPDATE in the RTE, then "tv14" does not get the latest code!

    Is there a field I am missing for TinyMCE that has the current code to validate against?

    Thanks inn advance,

    J [ed. note: jusmeig last edited this post 14 years, 11 months ago.]
      • 15083
      • 697 Posts
      Anyone?
      I tried to update the textarea myself using JS but the content does not seem to come through....
        • 15083
        • 697 Posts
        *THINK I got this one fixed*
        I opened the following file in TINYMCE:
        assets\components\tinymce\jscripts\tiny_mce\themes\advanced\source_editor.htm

        Added this function:

                function update_fix()
                {
                    /* Check if the update field is empty, need to empty the hidden field as we are validating against this */
                    if(document.getElementById('htmlSource').value == '')
                    {
                        /* If the user has blanked the html source, blank the hidden field! */
                        window.opener.document.getElementById(tinyMCE.activeEditor.editorId).value = '';
                    }
                    /* Set the content of the actual editor equal to the html source */
                    tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true});
        	        /* Need to call this to sync the editor and the save field * (might not be needed because of above) */
                    window.opener.tinyMCE.triggerSave();
                    /* All done close the pop-up! */
                    tinyMCEPopup.close();
                }


        You also need to remove the onsubmit="" from the form, i've moved all the functionality into this fix.
        Works for me smiley