OnChange not reading attribute

Viewed 47

I have this

      tinyMCE.init({
    // General options
            selector: 'textarea', 
            forced_root_block: "",
    theme: "silver",
    paste_text_sticky: true,
    paste_text_sticky_default: true,
    plugins: "paste,autolink,contextmenu,fullscreen,nonbreaking,template",
    //plugins: "wordcount,paste,autolink,advlink,fullscreen,nonbreaking,template,inlinepopups,style",

    // Theme options
    //theme_advanced_buttons1: "bold,italic,underline,strikethrough,|,undo,redo,|,justifyleft,justifycenter,justifyfull,|,link,unlink,|,fullscreen",
    //theme_advanced_buttons2: "cut,copy,paste,|,cleanup,removeformat,|,bullist,numlist,outdent,indent,hr,charmap",
    //theme_advanced_buttons1: "cut,copy,paste,removeformat,|,undo,redo,|,bullist,numlist,outdent,indent,|,formatselect,bold,italic,underline,forecolor,backcolor,|,justifyleft,justifycenter,justifyfull,|,link,unlink,|,fullscreen",
    theme_advanced_buttons1: "cut,copy,paste,removeformat,|,undo,redo,|,bullist,numlist,outdent,indent,|,bold,italic,underline,|,fullscreen",
    //theme_advanced_blockformats: 'p,h1,h2,h4,h4,h5,h6',
    theme_advanced_toolbar_location: "top",
    theme_advanced_toolbar_align: "left",
    //theme_advanced_statusbar_location : "bottom",
    theme_advanced_resizing: true,
    theme_advanced_path: false,
    // Example content CSS (should be your site CSS)
    selector: "textarea",
    content_css: "/css/admin.css",
    
    setup : function (ed) {
    
            ed.on('click', function () {                    
                new_value = tinymce.activeEditor.getContent()
                alert(new_value);
                new_value = new_value.replace(/,/g, "☀"); 
                alert(tinymce.DOM.getAttrib(ed,"data-hidden"));
                hidden_Field = tinymce.DOM.getAttrib(ed,"data-hidden");             
                $("#" + hidden_Field).val(new_value);       

     });

}, });

How do I get the value of the data-hidden attribute of the textarea that was filled in. tinymce.DOM.getAttrib(ed,"data-hidden"); isn't find anything as hidden_Field is, set when I do the alert. I am guessing Tinymce is ignoring it but how do I stop it from ignoring the attributeo

Thanks

0 Answers
Related