当我们自己在_layouts下或者MOSS的应用程序池里的项目想使用MOSS自带的RichText Editor控件:
其实用户很简单,2步搞定:
- 复制脚本
script>
- 填入脚本
<span dir="ltr">
<textarea name="comment" rows="6" cols="20" id="comment" title="说明" class="ms-long" dir="none"></textarea>
<input name="comment_spSave" type="HIDDEN" id="comment_spSave" />
</span>
<script>if (browseris.ie5up && browseris.win32 && !IsAccessibilityFeatureEnabled()){RTE_ConvertTextAreaToRichEdit("comment", true, false, "", "2052", null, null, null, null, null,"Compatible", "\u002f",null,null,false,null,null,null,null,null,null,true,null);}else{document.write(" <br><SPAN class=ms-formdescription><a href='javascript:HelpWindowKey(\"nsrichtext\")'>请单击此处了解有关添加基本 HTML 格式的帮助。</a></SPAN> <br>");};</script>
</span> - 控制大小
#comment
{
width: 356px;
} - 获取RTE: 变量strHtml中
strHtml;
var strBaseElementID = "comment";
//var elemTextArea=RTE_GetEditorTextArea(strBaseElementID);
var docEditor=RTE_GetEditorDocument(strBaseElementID);
strHtml=docEditor.body.innerHTML;
- 更改样式:FullHtml
);
- 使用示例: 信息反馈收集
- 第二种方法最简单了:
AllowExternalUrls="false"
AllowFonts="true"
AllowReusableContent="false"
AllowHeadings="false"
AllowHyperlinks="false"
AllowImages="false"
AllowLists="false"
AllowTables="false"
AllowTextMarkup="false"
AllowHTMLSourceEditing="false"
DisalbeBasicFormattingButtons="false"
runat="server"/>