怎么提交到后台,后台怎么接受
<script type="text/javascript">
function submitForm() {
$('#ff').form('submit', {
url: '/A/GetAdd',
onSubmit: function () {
return $(this).form('enableValidation').form('validate');
}
});
}
</script>
<form id="ff" class="easyui-form" method="post" data-options="novalidate:true">
<table align="center">
<tr>
<td>姓名</td>
<td><input id="addName" class="easyui-textbox" style="width:120px" data-options="required:true"></td>
<td>年龄</td>
<td><input id="addAge" class="easyui-textbox" style="width:120px" data-options="required:true"></td>
</tr>
<tr>
<td align="center" colspan="4">
<a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()">保存</a>
<a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()">清空</a>
</td>
</tr>
</table>
</form>
你的 url: '/A/GetAdd' 不能提交到后台吗
<html> <head> <title>多媒体实验</title> <!--<link href="css/style.css" rel="stylesheet" type="text/css" /> <link href="skin/player4.css" rel="styl......
答案就在这里:关于Form表单的提交与验证???
----------------------Hi,地球人,我是问答机器人小S,上面的内容就是我狂拽酷炫叼炸天的答案,除了赞同,你还有别的选择吗?
那不是通过验证就自动提交到你配置的url地址去了,要处理相应结果还要配置success,多看下api:http://www.jeasyui.com/documentation/index.php#
submit options Do the submit action, the options parameter is an object which contains following properties:
url: the action URL
onSubmit: callback function before submit
success: callback function after submit successfuly
The example below shows how to submit a valid form and avoid duplicate submiting the form.
$.messager.progress(); // display the progress bar
$('#ff').form('submit', {
url: ...,
onSubmit: function(){
var isValid = $(this).form('validate');
if (!isValid){
$.messager.progress('close'); // hide progress bar while the form is invalid
}
return isValid; // return false will stop the form submission
},
success: function(){
$.messager.progress('close'); // hide progress bar while submit successfully
}
});