/*
* 用户带验证码登录页面
* sheak
* code.php 生成验证码
* 1202增加键盘回车提交功能(粗体部分)
*/
/*
* 用户带验证码登录页面
* sheak 081115
* code.php 生成验证码
*/
Ext.QuickTips.init();
LoginWindow=Ext.extend(Ext.Window,{
title : '登陆系统',
width : 275,
height : 155,
collapsible : true,
defaults : {
border : false
},
buttonAlign : 'center',
createFormPanel :function() {
//表单重置函数
function reset(){
myform.form.reset();
};
//表单提交函数
function surely() {
if(myform.getForm().isValid())
{
myform.form.submit({
waitMsg : '正在登录......',
url : '../../../index/login',
timeout: 3000,
success : function(form, action) {
if(action.result.type == 0)//OP
window.location.href = '../op/index.html';
else//CP
window.location.href = 'index.html';
},
failure : function(form, action) {
form.reset();
if (action.failureType == Ext.form.Action.SERVER_INVALID)
Ext.MessageBox.alert('警告', action.result.errors.msg);
}
});
}
};
var myform = new Ext.form.FormPanel( {
bodyStyle : 'padding-top:6px',
defaultType : 'textfield',
labelAlign : 'right',
labelWidth : 55,
labelPad : 2,
//frame : true,
method:'POST',
//增加表单键盘事件
keys:[
{
key: [10,13],
fn:surely
} ],
defaults : {
allowBlank : false,
width : 158
},
items : [{
cls : 'user',
name : 'username',
fieldLabel : '帐 号',
blankText : '帐号不能为空'
}, {
cls : 'key',
name : 'password',
fieldLabel : '密 码',
blankText : '密码不能为空',
inputType : 'password'
}, {
cls : 'key',
name:'randCode',
id:'randCode',
fieldLabel:'验证码',
width:70,
blankText : '验证码不能为空'
}],
buttons:[
{
text:'确定',
id:'sure',
handler:surely
},
{
text:'重置',
id:'clear',
handler:reset
}]
});
return myform;
},
initComponent : function(){
LoginWindow.superclass.initComponent.call(this);
this.fp=this.createFormPanel();
this.add(this.fp);
}
});
Ext.onReady(function()
{
var win=new LoginWindow();
win.show();
var bd = Ext.getDom('randCode');
var bd2 = Ext.get(bd.parentNode);
bd2.createChild({tag: 'img', src: 'code.php',align:'absbottom'});
}
);
分享到:
相关推荐
ExtJS登入验证码的实现 采用mvc的格式写的代码
Extjs4登录功能+验证码+struts2
C# Extjs 登陆框、框架 特效不错。注释很全面
ExtJs5 去掉textfield边框
ssh整合实现登录的例子,包含源代码,用extjs做的登录界面,作为新手入门的好东西,不下会后悔的。。。
NULL 博文链接:https://master3003.iteye.com/blog/1143947
Extjs框架Extjs框架Extjs框架Extjs框架Extjs框架Extjs框架Extjs框架Extjs框架Extjs框架
extjs带复选框的树包括全选 反选 子选父以及 父选子 与adf在jsp页面得应用 包含了工具类以及针对extjs树节点增加、删除、修改的工具方法
Extjs4后台框架
应用ExtJs技术、SSH框架开发的权限管理系统的详细设计文档
ASP.net Extjs 网站通用后台 框架 VS2010开发
自己动手搭extjs4.0.7后台管理框架,动态树+动态多标签
Extjs 2 自定义panel边框,解决双重边框问题 Extjs 3 自定义panel边框,解决双重边框问题 Extjs 4 自定义panel边框,解决双重边框问题
extjs6.6框架的web项目,此资源是上一个资源的更新版。 用senchacmd成功发布,通过改变base-color改变主题风格,功能包含登录页、首页左菜单和列表,详见代码及部署说明文档。
ExtJs自定义消息框,自带的消息框,可以下载来了解一下。
extjs弹出框 n秒后消失 信息可以自定义 时间可以自己定 extjs弹出框 n秒后消失 信息可以自定义 时间可以自己定
extjs4.1 框架和文档 从官网下载的extjs-4.1.0-rc1
Extjs框架基础.pptExtjs框架基础.ppt
13款extjs经典后台框架.总有一款适合你。本人精心积累,5点积分不算多。
论坛上找的ExtJs消息提示框,各个方向的都有,十分人性化