主题: 提交后 编辑器中的内容丢失(付整页源码,求解) |
作者: 中国帝购网络, 发布日期: 2011-08-04 18:42:10, 浏览数: 3883 |
操作系统: Windows 7 & IIS7.5
浏览器: IE8 & 遨游3 KindEditor版本: 3.5.5 BUG再现步骤: 1.同样代码页面新增信息时,正常 2.对信息进行修改时,待修改信息显示正常,修改后提交但是程序接收不到编辑器中的内容。 3.详细页面代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <html> <head> <title>网站资料</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Cache-Control" content="no-cache"> <meta http-equiv="Expires" content="0"> <link href="images/css.css" rel="stylesheet" type="text/css"> <script type="text/javascript" charset="utf-8" src="/kindeditor/kindeditor.js"></script> <script> KE.show({ id : 'bcontent', imageUploadJson : '../kindeditor/asp/upload_json.asp', fileManagerJson : '../kindeditor/asp/file_manager_json.asp', allowFileManager : true, resizeMode : 1, afterCreate : function(id) { KE.event.ctrl(document, 13, function() { KE.util.setData(id); document.forms['editform'].submit(); }); KE.event.ctrl(KE.g[id].iframeDoc, 13, function() { KE.util.setData(id); document.forms['editform'].submit(); }); } }); </script> <script language="Javascript"> function display(ID) { if (document.getElementById(ID).style.display == "none") { document.getElementById(ID).style.display = ""; }else{ document.getElementById(ID).style.display = "none"; } } function checkAll(bCheck) { var arr = document.all.listid; if (typeof(arr)!="undefined") { for(var i=0; i<arr.length; i++) { if(!arr[i].disabled == true) arr[i].checked = bCheck; } } } function checkform(form) { var flag=true; if(form("bClassID").value=="0"){alert("请选择分类!");form("bClassID").focus();return false;} if(form("bTitle").value==""){alert("标题名称不能为空!");form("bTitle").focus();return false;} return flag; } </script> </head> <body topmargin="5" leftmargin="5" bgcolor="#ffffff"> <form autocomplete="off" name="editform" id="editform" method="post"> <table width="100%" border="0" cellspacing="0" cellpadding="0" height="24"> <tr valign="bottom"> <td>你现在的位置:<font color="DarkSlateGray" style="font-size:12px"><b>新闻管理</b></font> -> 编辑新闻 ← <a href="admin_news.asp">返回列表</a> </td> <td></td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr><td><hr size="1"></td></tr> <tr bgcolor="#898989"><td height="23"><font class="t2"> 详细资料</font></td></tr> <tr><td height="10"></td></tr> </table> <table width="100%" border="0" cellspacing="1" cellpadding="2" align="center" bgcolor="#e6e6e6"> <tr> <td align="right" class="td1" valign="middle">所属分类:</td> <td class="td2"> <select name="bClassID" id="bClassID"> <option value="0">--选择分类--</option> <option value='1'selected='selected'>┿ 站内新闻</option><option value='2'>┿ 行业新闻</option><option value='4'>┿ 政策法规</option> </select> <font color="#ff0000">*</font> </td> </tr> <tr> <td class="td1" align="right" valign="middle">标题:</td> <td class="td2"> <input type="text" name="bTitle" id="bTitle" value="阿萨德飞11" size="60"> <font color="#ff0000">*</font> </td> </tr> <tr> <td align="right" class="td1" valign="top">内容图片:</td> <td class="td2"> <input type="text" class="input" id="bPic" name="bPic" value="" style="width:250px;" /> <input type="checkbox" onclick="display('upload');" id="box"/><label for='box'>上传图片</label> <font color ="#ff0000">如果这里置空,则系统自动提取内容中的第一张图片</font> <br> <div id="upload" style="display:none;" class="td2"> <iframe src="upload.asp?go=pic" frameborder='0' style='height:22px;width:100%;' scrolling='no'></iframe> </div> </td> </tr> <tr> <td width="15%" class="td1" align="right">作者:</td> <td width="85%" class="td2"> <input type="text" name="bWriter" id="bWriter" size="20" value="管理员" maxlength="50"> <button class="button" onClick="bWriter.value='管理员'">管理员</button> <button class="button" onClick="bWriter.value='未知'">未知</button> </td> </tr> <tr> <td align="right" class="td1">来源:</td> <td class="td2"> <input type="text" id="bCopyRight" name="bCopyRight" size="20" value="本站" maxlength="50"> <button class="button" onClick="bCopyRight.value='本站'">本站</button> <button class="button" onClick="bCopyRight.value='未知'">未知</button> <button class="button" onClick="bCopyRight.value='互联网'">互联网</button> </td> </tr> <tr> <td align="right" class="td1">置顶推荐:</td> <td class="td2"> <input name="bIsTop" id="bIsTop" type="checkbox" value="1" checked/><label for="bIsTop">置顶</label> <input name="bIsBest" id="bIsBest" type="checkbox" value="1" checked/><label for="bIsBest">推荐</label> <input name="bIsReply" id="bIsReply" type="checkbox" value="1" /><label for="bIsReply">推荐</label> <input name="bIsPass" id="bIsPass" type="checkbox" value="1" checked/><label for="bIsPass">审核通过</label> </td> </tr> <tr> <td align="right" class="td1" valign="top">内容:</td> <td class="td2"> <textarea id="bcontent" name="bcontent" cols="100" rows="8" style="width:730px;height:300px;visibility:hidden;">阿萨德飞</textarea></td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td width="150" align="right" height="40"></td> <td> <input type="button" class="button" name="submit1" value="确认提交" onclick="if(checkform(editform)){this.form.action='admin_news.asp?go=saveedit&id=105';this.form.submit();}"> <input type="reset" class="button" value="重新填写" name="Button"> </td> </tr> </table> </form> <script language="Javascript"> editform.bTitle.focus() </script> </body> </html> 期望结果: 可正常修改记录信息。具体问题出现在何处~? |
作者: 中国帝购网络, 发布日期: 2011-08-04 19:20:23 |
通过 逐段删除的办法 找到 问题所在,但是不是很理解原因(因为我是业余选手)。 |
回复 |
作者: Roddy, 发布日期: 2011-08-04 20:22:31 |
回复中国帝购网络:checkform函数的第一行里添加 KE.sync('bcontent');
|
回复 |