form表单添加富文本编辑器
<div class="control-group"> <label class="control-label">内容:</label> <div class="controls"> <textarea id="editor" name="context" style="height: 600px;">${hmlwxItinerantExhibition.context }</textarea> <script type="text/javascript"> //实例化编辑器 //建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例 var ue = UE.getEditor('editor'); //弹出图片上传的对话框 function upImage() { var myImage = ue.getDialog("insertimage"); myImage.open(); } </script> </div>
需要引入
<script type="text/javascript" charset="utf-8" src="${ctxStatic}/formdesign/js/ueditor/ueditor.config.js"></script> <script type="text/javascript" charset="utf-8" src="${ctxStatic}/formdesign/js/ueditor/ueditor.all.min.js">