87,907
社区成员
发帖
与我相关
我的任务
分享
bodyStyle : 'padding:0 0 0 300px;width:60%;height:100%;',
<script type="text/javascript">
Ext.onReady(function() {
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'side';
var bd = Ext.getBody();
bd.createChild({ tag: 'h2', html: '' });
var simple = new Ext.FormPanel({
labelWidth: 75, // label settings here cascade unless overridden
frame: true,
title: 'Login Window',
bodyStyle: 'padding:5px 5px 0',
width: 350,
x: 400,
y: 300,
renderTo: bd,
defaults: { width: 230 },
defaultType: 'textfield',
items: [{
id: 'userid',
fieldLabel: 'UserId',
name: 'first'
}, {
id: 'pass',
fieldLabel: 'Password',
inputType:'password',
name: 'last'
}
],
buttons: [{
text: 'Login',
handler: function() {
var user_id = Ext.getDom('userid').value;
var pass = Ext.getDom('pass').value;
Ext.Ajax.request({
url: "Login.ashx",
method: "post",
params: { userid: user_id, password: pass },
success: function() { window.open("index.aspx"); }
});
}
}]
});
simple.render(document.body);
document.body.style.marginLeft= (document.body.clientWidth - simple.getForm().getEl().dom.clientWidth)/2;
document.body.style.marginTop= (document.body.clientHeight - simple.getForm().getEl().dom.clientHeight)/2;
});
</script>
simple.render(document.body);
document.body.style.marginLeft= (document.body.clientWidth - simple.getForm().getEl().dom.clientWidth)/2;
document.body.style.marginTop= (document.body.clientHeight - simple.getForm().getEl().dom.clientHeight)/2;
<script type="text/javascript">
Ext.onReady(function() {
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'side';
var bd = Ext.getBody();
bd.createChild({ tag: 'h2', html: '' });
var simple = new Ext.FormPanel({
labelWidth: 75, // label settings here cascade unless overridden
frame: true,
title: 'Login Window',
bodyStyle: 'padding:5px 5px 0',
width: 350,
x: 400,
y: 300,
renderTo: bd,
defaults: { width: 230 },
defaultType: 'textfield',
items: [{
id: 'userid',
fieldLabel: 'UserId',
name: 'first'
}, {
id: 'pass',
fieldLabel: 'Password',
name: 'last'
}
],
buttons: [{
text: 'Login',
handler: function() {
var user_id = Ext.getDom('userid').value;
var pass = Ext.getDom('pass').value;
Ext.Ajax.request({
url: "Login.ashx",
method: "post",
params: { userid: user_id, password: pass },
success: function() { window.open("index.aspx"); }
});
}
}]
});
document.body.style.textAlign="center";
simple.render(document.body);
document.body.style.marginTop= (document.body.clientHeight - simple.getForm().getEl().dom.clientHeight)/2;
});
</script>