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.msgDraft 0
msg.msgTitle 22
msg.msgType 3
upload
为何就只有msgContents提交为空???纠结啊!jsp,jquery,ajax
<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.msgDraft 0
msg.msgTitle 22
msg.msgType 3
upload
为何就只有msgContents提交为空???纠结啊!jsp,jquery,ajax
function Save(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 %>");
}
});
}我发现我用这段代码就能够提交;可是用复制黏贴出来的就提交不了
<input type="submit" name="save">
<input type="submit" name="delete">
<input type="submit" name="new">
<input type="submit" name="save">
<input type="submit" name="delete">
<input type="submit" name="new">
那个submitID:'Save,delete,new'这样写吗? 不行啊
不允许有多个值
不允许有多个值哎。。我用jquery取值提交吧
不允许有多个值哎。。我用jquery取值提交吧
想法总比困难多