本文实例为大家分享了Jquery Easyui表单组件的实现代码,供大家参考,具体内容如下
加载方式
表单组件只能在射流研究…区域设置,首先定义一张表单。
表单id='box '方法=' post ' div label for=' name ' name :/label input class=' easui-validate box ' type=' text ' name=' name ' data-options='必需d : true '/div label for=' email ' email :/label input class=' easui-validate box ' type=' text ' name=' email ' data-options=' validat type : ' email ' '/div input type=' submit '/表单脚本$ '加载调用$('#box ').表单({ url : 'content.php ',onSubmit:函数(){ },success :函数(数据){ alert(数据);} });});/script属性列表
//属性设置$('#box ').表单({ url : 'content.php ',});事件列表
script $(function () { //JS加载调用$('#box ').表单({ url : 'content.php ',onSubmit:函数(){ },success :函数(数据){ alert(数据);},onBeforeLoad :函数(){警报('加载之前执行');},onLoadSuccess :函数(数据){警报('加载成功后执行:' '数据。姓名);},onLoadError :函数(){警报('加载错误时执行');}, });});/script方法列表
//自动提交$('#box ').表单(' submit ',{ });//使用负荷填充$('#box ').表单(' load ',{ name : 'bnbbs ',email : '[emailprotected]',});//使用负荷通过统一资源定位器填充,对方是JSON格式$('#box ').表单(' load ',' content。PHP’);//验证后再执行提交$('#box ').表单({ url : 'content.php ',onSubmit :函数{ return $(this)} .表单(“验证”);},成功:函数(数据){ alert(数据);}, });//清理和重置$('#box ').形式(“清除”);$('#box ').表单("重置");//禁用和启用验证$('#box ').表单(“禁用验证”);$('#box ').表单(“启用验证”);//使用$.fn.form.defaults重写默认值对象。以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持我们。