easyui form验证表单后怎么提交

怎么提交到后台,后台怎么接受

<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>

3个回答

你的 url: '/A/GetAdd' 不能提交到后台吗

jiaoye6789
jiaoye6789 后台要怎么接受这两个值
3 年多之前 回复

<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
    }
});
showbo
支付宝加好友偷能量挖 回复jiaoye6789: request啊,就和普通表单提交一样,该怎么获取就怎么获取
3 年多之前 回复
jiaoye6789
jiaoye6789 后台要怎么接受这两个值
3 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问