amazeui表单form异步提交方法
// 留言提交
$(function() {
var $form = $('#ue-form');
$form.validator({
validateOnSubmit: true,
submit: function() {alert(1)
if(this.isFormValid()) {
$.post(
"{:url('index/msg')}",
$("input[type=\'text\'],input[type='email'],select"),
function(d){
console.log(d);
}
, "json");
}
return false;
}
});
})
<form id="ue-form" class="am-form">
<fieldset>
<input type="hidden" value="0">
<div class="t_box">
<div class="am-form-group">
<input type="text" placeholder="名*" name="ming" class="am-form-field"
required="名字不能为空"> </div>
<div class="am-form-group">
<input type="text" placeholder="姓*" name="xing" class="am-form-field"
required="">
</div>
</div>
<div class="am-form-group">
<input type="email" placeholder="电子邮箱*" name="email" required="">
</div> <div class="am-form-group">
<input type="text" placeholder="公司名称*" name="company" class="am-form-field"
required="">
</div>
<div class="t_box">
<div class="am-form-group">
<input type="text" placeholder="职务*" name="job" class="am-form-field"
required=""> </div>
<div class="am-form-group">
<select name="county_id" class="am-form-field">
<option value="">国家</option>
{volist name="country" id="c"}
<option value="{$c.id}">{$c.name}</option>
{/volist}
</select>
</div>
</div>
<div class="am-form-group">
<input type="text" placeholder="备注" name="beizhu" class="am-form-field">
</div>
<div class="t_bitian">
*必填内容
</div>
<button class="btn" type="submit">提交</button>
</fieldset>
</form>
amazeui表单form异步提交方法的更多相关文章
- 雷林鹏分享:jQuery EasyUI 表单 - 创建异步提交表单
jQuery EasyUI 表单 - 创建异步提交表单 本教程向您展示如何通过 easyui 提交一个表单(Form).我们创建一个带有 name.email 和 phone 字段的表单.通过使用 e ...
- 【Codebase】JQuery获取表单部分数据提交方法
JQuery使用ajax提交整个表单最简便的方法就是$('#form').serialize();但如果仅想保存表单中的部分数据,比如仅更新选中的条目,那么获取数据就比较麻烦了. 解决方法:新建一个表 ...
- 使用jQuery重用form表单并异步提交到其它action
在做页面开发的时候,有时候要重用表单的数据,并异步请求提交到其它的链接中,这个时候就能够使用jquery去改动表单的action值(记得使用后改动回来).并调用submit方法,当然后台的链接acti ...
- form表单转Json提交方法
先将表单数值转换成数组存储,存储成的格式为[{"name":"","value":""},.....}] var for ...
- 关于防止表单form重复提交的方式
表单重复提交: 1.第一种:添加以后刷新页面(刷新的是Servlet) 2.第二种:重复点击提交按钮. * 使用令牌机制:(防止表单重复提交) * 在表单页面中 生成一个令牌 * 将这个令牌保存在se ...
- 表单 - Form - EasyUI提供的表单异步提交
方案一 被提交的表单 <form id="loginForm" method="post"> <table align="cente ...
- 使用JS对form的内容验证失败后阻止提交 &&js校验表单后提交表单的三种方法总结
1.form的两个事件 submit,提交表单,如果直接调用该函数,则直接提交表单 onSubmit,提交按钮点击时先触发,然后触发submit事件.如果不加控制的话,默认返回true,因此表单总能提 ...
- Ajax提交Form表单的一种方法
待提交的表单 <form id="updatePublicKey" enctype="multipart/form-data"> <div c ...
- Mvc 提交表单的4种方法全程详解
一,MVC HtmlHelper方法 Html.BeginForm(actionName,controllerName,method,htmlAttributes){} BeginRouteForm ...
随机推荐
- Beamer中左边画图, 右边文字解释
\begin{columns} \column{.4\textwidth} \begin{figure} \centering % Requires \usepackage{graphicx} \in ...
- Collections of Zujin Zhang's Published works
I am not good, but I shall do my best to be better. Any questions, please feel free to contact zhang ...
- [译]Ocelot - Big Picture
原文 目录 Big Picture Getting Started Configuration Routing Request Aggregation Service Discovery Authen ...
- java8 按对象属性值分组
Map<String, List<User>> userMap = list.stream().collect(Collectors.groupingBy(User::getG ...
- 第九节,MXNet:用im2rec.py将图像打包生成.rec文件
1.生成.lst文件 制作一个文件路径和标签的列表: import os import sys #第一个参数是输入路径 input_path=sys.argv[1].rstrip(os.sep) #第 ...
- [笔记]猿计划(WEB安全工程师养成之路系列教程):02HTML头部标签
1.什么是HTML? HTML是用来描述网页的一种语言 HTML——超文本标记语言(Hyper Text Markup Language) HTML不是编程语言,是一种标记语言 标记语言是一套标记标签 ...
- js设置document.domain实现跨域
document.domain 只能实现跨子域的问题 如:xxx.com/a.html 和aaa.xxx.com/b.html 或:bbb,xxx.com/c.html 和ccc.xxx.com/d. ...
- 近日测试发现所有Excel相关功能均会抛异常,查后发现与福昕阅读器不兼容
报这种错: System.Runtime.InteropServices.COMException (0x80010105): 服务器出现意外情况. (异常来自 HRESULT:0x80010105 ...
- Linux -- Centos6 yum安装相关问题与处理
Centos6 yum安装相关问题与处理 由于要使用yum下载文件,突然yum下载不了想要的文件,想更换yum源,结果得重新安装yum 来自本人GitHub地址https://github.com/m ...
- JavaScript读取对象属性遇到的问题
JavaScript中对于对象的属性存取方式有两种:“.”操作和[]操作. “.”操作属性名通常直接写,[]操作中属性的名字通常要加引号, 而当需要读取的对象属性名是一个变量的时候,一般使用[]操作, ...