主题: 好心人帮我看下 为什么textarea获得的值是空的
作者: xinYI上锁, 发布日期: 2013-12-17 21:40:41, 浏览数: 2427

好心人帮我看下 为什么textarea获得的docAuthor值是空的 
而在<好心人帮我看下 为什么textarea获得的值是空的 


在<textarea></textarea >标签里加默认值后台是可以获得docAuthor的值


<%@ Page Language="C#" AutoEventWireup="true" validateRequest="false" %>

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
Session["docAuthor"] = txtAuthorInfo.Value;
}

</script>

<!doctype html>

<html>
<head runat="server">
    <meta charset="utf-8" />
    <title>KindEditor ASP.NET</title>
 
<script charset="utf-8" src="../kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="../kindeditor/lang/zh_CN.js"></script>
<script>
 var editor;
 KindEditor.ready(function(K) {
 editor = K.create('textarea[name="txtAuthorInfo"]', {
 allowFileManager: true,
 afterBlur: function(){this.sync();}
 
 });
  
 });
</script>
</head>
<body>
 
   <textarea id="txtAuthorInfo" name="txtAuthorInfo" cols="100" rows="8" style="width:700px;height:400px;visibility:hidden;" runat="server"></textarea>
        <br />

</body>

</html>




发表新帖 发表回复