首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

jquery交付form表单时,有一个属性提交为空。

2013-09-05 
jquery提交form表单时,有一个属性提交为空。。。form表单如下:form idsubForm methodpostinput type

jquery提交form表单时,有一个属性提交为空。。。
form表单如下:
<form id="subForm" method="post">
    <input type="hidden" id="type" name="msg.msgType" value=""/>
    <input type="hidden" id="draft" name="msg.msgDraft" value=""/>
  <table class="biaodan" style="width:80%;margin-bottom: 15px;border: 1px solid #eee;">
  <tr>
  <td width="400">
  主题:<input name="msg.msgTitle"  type="text" value="<s:property value="msg.msgTitle"/>" style="width:400"/>
  </td>
</tr>
<tr>
<td>附件:<span id="fileQueue"></span><input type="file" name="upload" id="fileupload" /><ol id="files"></ol>
</td>
</tr>
<tr>
    <td><textarea name="msg.msgContents" class="xheditor {upImgUrl:'<%=basePath%>/servlet/upload',submitID:'Save',height:350}"  style="width:80%">
    </textarea></td>
</tr>
  </table>
  </form>

提交:
function SaveAsDraft(btnId){
var type=$("#classify").val();
$("#type").val(type);
$("#draft").val(0);
$('#subForm').form('submit',{
        url: '<%=basePath%>/admin/info/addInfo.do',
        onSubmit: function(){  
            return $(this).form('validate');
        },
        success: function(data){
        $.messager.alert('提示信息','已保存。');
        parent.reloadParent("<%=parentTabId %>");
        }  
    }); 
}
查看post参数如下:
msg.msgContents
msg.msgDraft0
msg.msgTitle22
msg.msgType3
upload
为何就只有msgContents提交为空???纠结啊! jsp,jquery,ajax

[解决办法]
用xheditor 编辑器了

热点排行