请教ASP怎么获取summernote文本编辑器的值?

qq_21575223 2016-05-07 12:47:04
此为修改页面


                            <form class="form-horizontal" action="?act=editapps&u_id=<%=rs("a_id")%>" method="post" name="editapps" role="form">
<tr>
<td class="col-md-2"><label class="control-label" for="a_content">应用简介</label></td>
<td class="col-md-10"><div id="summernote"><%=rs("a_content")%></div></td>
</tr>
<tr>
<td class="col-md-2"><label class="control-label"></label></td>
<td class="col-md-10"><button type="submit" class="btn btn-lg btn-primary btn-block">修改</button></td>
</tr>
</form>


这个是我精简的表单,方便阅读。

get & set Code
Get the HTML contents of the first summernote in the set of matched elements.

var markupStr = $('#summernote').summernote('code');
If you initialize multiple editor, You can get the HTML content of the second summernote with jQuery eq.

var markupStr = $('.summernote').eq(1).summernote('code');
A string of HTML to set as the content of each matched element.

var markupStr = 'hello world';
$('#summernote').summernote('code', markupStr);


这个是官方给出的方法。

$(document).ready(function() {
var a_content = $('#summernote').summernote('code');
$('#summernote').summernote({
height: 100,
minHeight: null,
maxHeight: null,
focus: true,
lang: 'zh-CN'
});


这个是我参照官方文档写的JS。我现在点击提交按钮ASP页面获取不到summernote文本编辑器的值,为空。
...全文
1817 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
什么都不能 2017-12-11
  • 打赏
  • 举报
回复
       var code = $("#editor").code();
       $("#essayText").val(code);
       if($("#essayCategory").val() === '') {
           return;
       }
       $("#add_form").submit();
  • 打赏
  • 举报
回复
$('.summernote').summernote('code');
夜尔九九 2017-03-23
  • 打赏
  • 举报
回复
引用 4 楼 98ok 的回复:
var sHTML = $('.summernote').code();
这个code方法我似乎没有啊
kingstou 2016-07-27
  • 打赏
  • 举报
回复
var sHTML = $('.summernote').code();
zhanggq1308 2016-07-25
  • 打赏
  • 举报
回复
你的问题,解决了吗?能分享下经验吗
hookee 2016-05-08
  • 打赏
  • 举报
回复
form里写个隐藏的textarea ,递交前把 content赋值到这个textarea里,和表单一起递交。
oooge 2016-05-07
  • 打赏
  • 举报
回复
没人吗?求救

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧