/* <form id="ff" method="post"> ... </form> */ function submitForm(){ /* form()参数: submit 提交表单 validate 用于验证提交 clear 清除所有表单项 load 记载记录来填充表单 * */ $('#ff').form('submit',{ url: "http://diao:8080/crmnew/customer/add", onSubmit: function(){ //提交前触发 //做一些检查来阻止提交 return $(this).form('validate'); }, //返回的状态需要是success success: function(result){ /* console.info(result); */ var result = eval('('+result+')'); if (result.success){ $('#dlg').dialog('close'); $('#datagrid').datagrid('reload'); } else { mesTitle = '新增用户失败'; } $.messager.show({ title: mesTitle, msg: result.msg }); } }); } function clearForm(){ $('#ff').form('clear'); } </script>
http://www.jeasyui.net/plugins/166.html
评论一下?