富文本框tinyeditor的用法
来源:互联网 发布:arcgis裁剪栅格数据 编辑:程序博客网 时间:2024/05/17 22:09
一、导入 tinyeditor的类和js包,具体tinyeditor包在我的资源里面有的,网上也有很多资源,自己下载,此处不做多介绍
<link rel="stylesheet" href="../tinyeditor/style.css" />
<script type="text/javascript" src="../tinyeditor/tinyeditor.js"></script>
二、添加textarea控件
<textarea id="input" style="width:400px; height:200px"></textarea>
<script type="text/javascript">
var instance = new TINY.editor.edit('editor', {
id: 'input',
width: 584,
height: 175,
cssclass: 'te',
controlclass: 'tecontrol',
rowclass: 'teheader',
dividerclass: 'tedivider',
controls: ['bold', 'italic', 'underline', 'strikethrough', '|', 'subscript', 'superscript', '|',
'orderedlist', 'unorderedlist', '|', 'outdent', 'indent', '|', 'leftalign',
'centeralign', 'rightalign', 'blockjustify', '|', 'unformat', '|', 'undo', 'redo', 'n',
'font', 'size', 'style', '|', 'image', 'hr', 'link', 'unlink', '|', 'cut', 'copy', 'paste', 'print'],
footer: true,
fonts: ['新宋体', '黑体', 'Verdana', 'Arial', 'Georgia', 'Trebuchet MS', '微软雅黑', '宋体', '幼圆', '楷体', '华文行楷'],
xhtml: true,
cssfile: 'style.css',
bodyid: 'editor',
footerclass: 'tefooter',
toggle: { text: 'source', activetext: 'wysiwyg', cssclass: 'toggle' },
resize: { cssclass: 'resize' }
});
三、点击按钮获得文本框的输入值
1、前端获得值方法:
<asp:Button ID="Button1" runat="server" Text="提交" OnClientClick="checkform()" />
function checkform() {
instance.post();
var txtContent = document.getElementById("input").value;
}
2、后台获得值方法:
添加隐藏按钮<asp:HiddenField ID="txthidden" runat="server"/>
function checkform() {
instance.post();
var txtContent = document.getElementById("input").value;
document.getElementById('txthidden').value = txtContent;
}
<asp:Button ID="Button1" runat="server" Text="提交" OnClick="Button1_Click" />
在后台直接读取txthidden的值即可
- 富文本框tinyeditor的用法
- django的富文本框
- 富文本框的使用
- Bootstrap 集成富文本编辑框(tinyeditor)
- tinyeditor
- 富文本框的使用kindeditor
- Android 文本框的 富文本处理
- Uedtior富文本框的简单使用
- 富文本框KindEditor的使用技巧
- 含有百度富文本框的用户添加
- 富文本框ckeditor_4.4.7 文本框的简单使用 支持IE11
- 小小的富文本框,却包含挺多内容的,总结如下。javascript富文本框
- 富文本编辑器的用法
- 富文本框使用原则
- 富编辑文本框KindEditor
- web 富文本框 UEditor
- ckeditor富文本框控件
- html富文本框:kindeditor
- 关键字static/const的作用
- 机器学习之Validation(验证,模型选择)
- Objective-C 自定义UISlider滑杆 分段样式
- 推荐:iOS开发最佳实践总结
- 我的ionic配置
- 富文本框tinyeditor的用法
- Android ImageView的setImageLevel和level-list使用简介
- 01改变世界:机械之美——机械时期的计算设备
- linux配置网络可以访问外网总结
- SSM框架——详细整合教程(Spring+SpringMVC+MyBatis)
- poj1350
- LintCode Search Graph Node
- Apache Thrift - 可伸缩的跨语言服务开发框架
- javascript基础(函数)(十四)