ext form 如何异步验证
1个回答
展开全部
', maxLength:20, maxLengthText:'请您输入最多20个字符!', anchor:'95%' }, {xtype:'textfield', fieldLabel:'密码', id:'edit_SPIP', name:'operatorPassword', inputType:'password', minLength:6, minLengthText:'请您输入最少6个字符!', maxLength:20, maxLengthText:'请您输入最多20个字符!', allowBlank:false, vtype:'prolate_alphanum', vtypeText:'请您输入A-Z,a-z,0-9的字母数字组合!', anchor:'95%' }], buttons:[{text:'登录', handler:doSubmit },{text:'取消', handler:function(){Ext.MessageBox.confirm('提示信息', '当前数据将不会保存,您确定要取消吗?',function(btn){if(btn=="yes"){ adminLoginForm.getForm().reset();}});}}],keys:[{key:Ext.EventObject.ENTER, fn:doSubmit, scope:this }] });adminLoginWin=new Ext.Window({id:'adminLoginWin', name:'adminLoginWin', title:'<h2<div style="width:100%"<marquee behavior="scroll" scrollamount="2"<font color="black"欢迎使用移动工单管理系统</font</marquee</div</h2', iconCls:'icon-lock-s', width:adminLoginForm.width, height:adminLoginForm.height, closable:false, collapsible:false, draggable:false, resizable:false, maximizable:false, modal:false, border:true, items:[adminLoginForm] });adminLoginWin.show();}function doSubmit(){if(adminLoginWin.getComponent('operationInf').form.isValid()){adminLoginWin.getComponent('operationInf').form.submit({url:'adminLogin.do', waitTitle:'提示', method:'POST', waitMsg:'正在处理您的请求,请稍候...', success:function(form,action){try{var flag=action.result.success;if(flag==false){Ext.MessageBox.alert('提示',action.result.message);}else if(flag==true){adminLoginForm.getForm().reset();window.location.href="index_Tree.jsp";}}catch(e){Ext.MessageBox.alert('提示','对不起,您无法连接系统,如果您的网络正常,请联系系统管理员!');}}, failure:function(form,action){try{Ext.MessageBox.alert('提示',action.result.message);}catch(e){Ext.MessageBox.alert('提示','对不起,您无法连接系统,如果您的网络正常,请联系系统管理员');}}});}}
Ext.onReady(function(){
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget='side';
openLoginWindow();});后台返回JSON数据,输出如:
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询