1

在我的一个 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 具有Idvalue sub_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 的初始化方法。

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",


    });

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

4

0 回答 0