//定義表單 var simple = new Ext.FormPanel({ labelWidth: 75, baseCls: 'x-plain', width: 150, defaultType: 'textfield',//默認字段類型

//定義表單元素 ite " /> 中文字幕亚洲二区,亚洲人www,欧美性猛交xxxx免费看久久久

色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

ext實現完整的登錄代碼

Ext.form.Field.prototype.msgTarget = 'side';

//定義表單
var simple = new Ext.FormPanel({
labelWidth: 75, 
baseCls: 'x-plain',
width: 150,
defaultType: 'textfield',//默認字段類型

//定義表單元素
items: [{
fieldLabel: '帳戶',
name: 'name',//元素名稱
//anchor:'95%',//也可用此定義自適應寬度
allowBlank:false,//不允許為空
blankText:'帳戶不能為空'//錯誤提示內容
},{
inputType:'password',
fieldLabel: '密碼',
//anchor:'95%',
name: 'pws',
allowBlank:false,
blankText:'密碼不能為空'
}
],

buttons: [{
text: '登陸',
type: 'submit',
//定義表單提交事件
handler:function(){
if(simple.form.isValid()){//驗證合法后使用加載進度條
Ext.MessageBox.show({
title: '請稍等',
msg: '正在加載...',
progressText: '',
width:300,
progress:true,
closable:false,
animEl: 'loding'
});
//控制進度速度
var f = function(v){
return function(){
var i = v/11;
Ext.MessageBox.updateProgress(i, '');
};
};

for(var i = 1; i < 13; i++){
setTimeout(f(i), i*150);
}

//提交到服務器操作
simple.form.doAction('submit',{
url:'check.ASP',//文件路徑
method:'post',//提交方法post或get
params:'',
//提交成功的回調函數
success:function(form,action){
if (action.result.msg=='ok') {
document.location='index.html';
} else {
Ext.Msg.alert('登陸錯誤',action.result.msg);
}
},
//提交失敗的回調函數
failure:function(){
Ext.Msg.alert('錯誤','服務器出現錯誤請稍后再試!');
}
});

}
},{
text: '取消',
handler:function(){simple.form.reset();}//重置表單
}]
}); 
//定義窗體
var win = new Ext.Window({
id:'win',
title:'用戶登陸',
layout:'fit', //之前提到的布局方式fit,自適應布局 
width:300,
height:150,
plain:true,
bodyStyle:'padding:5px;',
maximizable:false,//禁止最大化
closeAction:'close',
closable:false,//禁止關閉
collapsible:true,//可折疊
plain: true,
buttonAlign:'center',
items:simple//將表單作為窗體元素嵌套布局
});
win.show();//顯示窗體

JavaScript技術ext實現完整的登錄代碼,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 中超| 江陵县| 全南县| 花垣县| 台州市| 南投市| 永修县| 棋牌| 汤原县| 太仆寺旗| 招远市| 丰县| 秦安县| 龙口市| 寿阳县| 稻城县| 江阴市| 安岳县| 涟水县| 曲阜市| 盐山县| 芜湖县| 鱼台县| 平江县| 万宁市| 曲松县| 内江市| 嘉义市| 罗江县| 曲松县| 新干县| 堆龙德庆县| 灌云县| 湘西| 兴安县| 黎城县| 靖宇县| 梁河县| 南安市| 封丘县| 涡阳县|