问题描述
不知道哦为啥没效果,求看看那里出了问题!Ext.onReady(function(){Ext.QuickTips.init();var loginForm=new Ext.FormPanel({standardSubmit: true, url:'MyJsp.jsp',renderTo:document.body,frame:true,title:'用户登陆',//bodyStyle:"padding:5px 5px 0",width:400,items:[{xtype:'fieldset',title:'用户登录',collapsible:true,autoHeight:true,defaultType:'textfield',items:[{fieldLabel:'用户名',name:'userName',width:180,allowBlank:false,blankText:'用户名不能为空',minLength:6,minLengthText:'用户名的长度为[6-20]',maxLength:20,maxLengthText:'用户名的长度为[6-20]'},{inputType:'password', fieldLabel:'密 码',name:'password',width:180,allowBlank:false,blankText:'密码不能为空',minLength:6,minLengthText:'密码的长度为[6-20]',maxLength:20,maxLengthText:'密码的长度为[6-20]'},{fieldLabel:'验证码',name:'validate',width:80,allowBlank:false,blankText:'验证码不能为空'}]}],buttons: [ { text: '登录', type:'button',handler:function() { if (!loginForm.getForm().isValid()) return; loginForm.getForm().submit(); } } ]});});
解决方案
我刚测试了一下 是你的标点符号错了Ext.onReady(function(){Ext.QuickTips.init();var loginForm=new Ext.FormPanel({standardSubmit: true, url:'MyJsp.jsp',renderTo:document.body,frame:true,title:'用户登陆',//bodyStyle:"padding:5px 5px 0",width:400,items:[{xtype:'fieldset',title:'用户登录',collapsible:true,autoHeight:true,defaultType:'textfield',items:[{fieldLabel:'用户名',name:'userName',width:180,allowBlank:false,blankText:'用户名不能为空',minLength:6,minLengthText:'用户名的长度为[6-20]',maxLength:20,maxLengthText:'用户名的长度为[6-20]'},{inputType:'password', fieldLabel:'密 码',name:'password',width:180,allowBlank:false,blankText:'密码不能为空',minLength:6,minLengthText:'密码的长度为[6-20]',maxLength:20,maxLengthText:'密码的长度为[6-20]'},{fieldLabel:'验证码',name:'validate',width:80,allowBlank:false,blankText:'验证码不能为空'}]}],buttons: [ { text: '登录', type:'button',handler:function() { if (!loginForm.getForm().isValid()) return; loginForm.getForm().submit(); } } ]});});完整代码 给你