d0uble_hel1x
5 Apr 2007, 7:04 AM
hi all,
i'm trying to encapsulate a login dialog box in frmLogin but the async "Control" doesn't seem to trigger. pointers appreciated.
thx!
function frmLoginPost()
{
//var UserID = this.getEl('login_username').value ;
var UserID = document.getElementById('login_username').value ;
var PW = document.getElementById('login_pw').value;
if (UserID=="") return;
var url = "?username=" + UserID + "&password=" + PW;
var callback={
success:function(i){
if(i.responseText == 'OK'){
dialog.hide();
LoadApp();
return;
}
document.getElementById('login_error_msg').innerHTML = i.responseText;
},
failure:function(response){
if(response.responseText !== undefined)loginDlg.show();
}
};
YAHOO.util.Connect.asyncRequest('GET', url, callback, url);
};
function frmLoginShow(fromWhere)
{
function Control(){
alert("hehe");
var postData = "?username=" + "" + "password=" + "";
var callback={
success:function(i){
if(i.responseText != 'OK') alert(i.responseText);
else { dialog.hide(); LoadApp();}
},
failure:function(response){
if(i.responseText !== undefined)loginDlg.show();}
};
YAHOO.util.Connect.asyncRequest('POST', sUrl, callback,postData);
}
if(!this.dialog){
this.dialog = new Ext.BasicDialog(
Ext.id(),
{autoCreate: true, title: _('login_title'),modal:false,width:300,height:180,shadow:true,resizable: false,proxyDrag: false,shim: true}
);
LoginTemplate.overwrite(this.dialog.body.id,
{ 'login_title': _('login_title'),
'login_username':_('login_username'),
'login_pw':_('login_pw')
});
//this.dialog.addButton('Login', this.Control,this.dialog); // why is this not working???
this.dialog.addButton('Login', frmLoginPost,this.dialog);
this.dialog.addKeyListener(27, this.dialog.hide, this.dialog);
this.dialog.addKeyListener(13, frmLoginPost, this.dialog);
};
this.dialog.show(fromWhere);
};
i'm trying to encapsulate a login dialog box in frmLogin but the async "Control" doesn't seem to trigger. pointers appreciated.
thx!
function frmLoginPost()
{
//var UserID = this.getEl('login_username').value ;
var UserID = document.getElementById('login_username').value ;
var PW = document.getElementById('login_pw').value;
if (UserID=="") return;
var url = "?username=" + UserID + "&password=" + PW;
var callback={
success:function(i){
if(i.responseText == 'OK'){
dialog.hide();
LoadApp();
return;
}
document.getElementById('login_error_msg').innerHTML = i.responseText;
},
failure:function(response){
if(response.responseText !== undefined)loginDlg.show();
}
};
YAHOO.util.Connect.asyncRequest('GET', url, callback, url);
};
function frmLoginShow(fromWhere)
{
function Control(){
alert("hehe");
var postData = "?username=" + "" + "password=" + "";
var callback={
success:function(i){
if(i.responseText != 'OK') alert(i.responseText);
else { dialog.hide(); LoadApp();}
},
failure:function(response){
if(i.responseText !== undefined)loginDlg.show();}
};
YAHOO.util.Connect.asyncRequest('POST', sUrl, callback,postData);
}
if(!this.dialog){
this.dialog = new Ext.BasicDialog(
Ext.id(),
{autoCreate: true, title: _('login_title'),modal:false,width:300,height:180,shadow:true,resizable: false,proxyDrag: false,shim: true}
);
LoginTemplate.overwrite(this.dialog.body.id,
{ 'login_title': _('login_title'),
'login_username':_('login_username'),
'login_pw':_('login_pw')
});
//this.dialog.addButton('Login', this.Control,this.dialog); // why is this not working???
this.dialog.addButton('Login', frmLoginPost,this.dialog);
this.dialog.addKeyListener(27, this.dialog.hide, this.dialog);
this.dialog.addKeyListener(13, frmLoginPost, this.dialog);
};
this.dialog.show(fromWhere);
};