PDA

View Full Version : Login Form Problem



usamecavga
20 Oct 2007, 2:24 AM
Hi All,

I want login screen but i cant get success:true or false.

[CODE]
var LoginDialog;
function ShowLoginDialog(){
if(!LoginDialog){ // lazy initialize the dialog and only create it once
LoginDialog = new Ext.LayoutDialog("LoginDiv", {
modal:true,
width:300,
height:120,
resizable:false,
shadow:true,
closable:false,
collapsible:false,
minWidth:300,
minHeight:300,
proxyDrag: true,
center: {
autoScroll:false,
closeOnTab: true,
alwaysShowTabs: false
}
});
var layout = LoginDialog.getLayout();
window.LoginDialog = LoginDialog;
layout.beginUpdate();
LoginDialog.setTitle('Login');
layout.add('center', new Ext.ContentPanel('LoginCenter'));
layout.endUpdate();
}
LoginDialog.show();
Ext.QuickTips.init();

// turn on validation errors beside the field globally
Ext.form.Field.prototype.msgTarget ='side';

var LoginForm = new Ext.form.Form({
id:'LoginForm'
});
LoginForm.column({width:300});
var UserNameVar = new Ext.form.TextField({
fieldLabel:'Username',
width:150,
name:'UserName',
allowBlank:false,
blankText:'L

Animal
20 Oct 2007, 2:27 AM
Don't post duplicate threads.

It makes people less likely to want to help you.

Animal
20 Oct 2007, 2:30 AM
What do you mean "can't get"?

Animal
20 Oct 2007, 2:31 AM
Docs for the Submit Action: http://extjs.com/deploy/dev/docs/?class=Ext.form.Action.Submit

See the example result format?

usamecavga
20 Oct 2007, 4:36 AM
Hi Animal,

Thank you for your reply. I opened the first thread by mistake. So I did open the second one.

My problem is:

When I submit the form I cannot get a response from the server side if it's "success:true" or "success: false". I almost have read every entry on the forum but could not find a solution. Is there a mistake on my codes? Could you help?

Best Regards,
Usame Cavga

Animal
20 Oct 2007, 5:11 AM
How are you attempting to debug this?

usamecavga
20 Oct 2007, 6:02 AM
Hi Animal,

My debugger is firebug.

When i want to alert "alert(data);" is undefined.
This code is the last one I tried . Before this one i tried the codes from your forum lots of time. But they did not work. i tried "a.result.data[0].responseMsg" too with other codes but i have error "a.result undefined".


LoginForm.on('actioncomplete', function(LoginForm, action){
var type = action.type; // e.g. "load"
var data = action.data; // your full json data pre parsed
alert(data); //Alert undefined
alert(type); //Alert submit
});

LoginForm.on('actionfailed', function(LoginForm, action){
if(action.type == 'submit' && action.failureType == Ext.form.Action.SERVER_INVALID){
// server side validation failed
}
});


If have you got script for login can you send me it?

Best Regards,
Usame Cavga

Animal
20 Oct 2007, 7:09 AM
Use Firebug poroperly. Set a breakpoint in the actioncomplete handler and examine the variables to see what's there and what you can use. Then you'll be able to fix your code easily.