TinyMCE删除textarea的指定id属性值并指定默认值

时间:2013-06-04 16:53:52

标签: ruby-on-rails attributes tinymce

在我的一个Rails应用程序中,我有一个表单,其中我有多个文本区域,并且我已为所有文本区域分配了特定的id属性值,但在加载表单时,通常文本区域会隐藏,我使用TinyMCE get方法(使用属性id)获取值。这里我的问题是,当加载表单时,Id属性的值也会更改为某个默认值。例如,

<%= text_area_tag "description",'', :class=>"validate[required,funcCall[checkHELLO]] text-input sub_description", :id=>"sub_question-text", :style=>"width: 426px;  height: 117px; border: 1px solid rgb(209, 209, 209); float:left;" %>

我指定的上述text_area具有Idsub_question-text,但是当加载表单时,它会更改为,

<textarea class="validate[required,funcCall[checkHELLO]] text-input sub_description" id="mce_33" name="description" style="width: 426px; height: 117px; border: 1px solid rgb(209, 209, 209); float: left; display: none;" aria-hidden="true"></textarea>

现在,id属性的值为mce_33

我有tinyMCE的以下init方法。

tinyMCE.init({
        // General options
        mode : "textareas",
        editor_selector : "sub_description",
        width:"350",
        theme : "advanced",
        plugins : "autolink,lists,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

        // Theme options
        theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,insertdate,inserttime,preview,|,forecolor,backcolor,|,hr,removeformat,|,sub,sup,charmap,|,ltr,rtl",
        //theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        //theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,

        // Skin options
        skin : "o2k7",
        skin_variant : "silver",

        // Example content CSS (should be your site CSS)
        content_css : "css/example.css",

        // Drop lists for link/image/media/template dialogs
        template_external_list_url : "js/template_list.js",
        external_link_list_url : "js/link_list.js",
        external_image_list_url : "js/image_list.js",
        media_external_list_url : "js/media_list.js",


    });

我不知道问题是什么。请帮忙。

0 个答案:

没有答案