<mce:script type="text/javascript"><!-- Ext.onReady(function(){ Ext.QuickTips.init(); Ext.form.Field.prototype.msgTarget = 'side'; var config = { title:'表单提交示例', labelWidth:60, width:230, frame:true, labelSeparator:':', renderTo:'form', items:[ new Ext.form.TextField({ fieldLabel:'用户名', name:'userName', allowBlank:false, blankText:'用户名不可为空', vtype:'email' }), new Ext.form.NumberField({ fieldLabel:'密码', name:'password', inputType:'password', allowBlank:false, blankText:'密码不可为空' }) ], buttons:[ new Ext.Button({ text:'登入', handler:login }), new Ext.Button({ text:'重置', handler:reset }) ] } var loginForm = new Ext.form.FormPanel(config); //按钮事件处理,提交表单数据 function login() { loginForm.form.submit({ clientValidation:true, waitMsg:'正在登入系统请稍后', waitTitle:'提示', url:'API/loginServer.ashx', method:'POST', success:function(form,action){ Ext.Msg.alert('提示','系统登入成功!'); }, failure:function(form,action){ Ext.Msg.alert('提示','系统登入失败,原因<br/>' + action.failureType); } }); } function reset() { loginForm.form.reset(); } }); // --></mce:script>