PDA

View Full Version : Success and Error Functions not Firing on Ajax Form Submit



gcallaghan
22 Sep 2010, 2:32 PM
I have a form that is submitting properly but the success and error functions do not appear to be firing.

I am testing on Sencha .93 and Google Chrome.

Here is my form code....


var LoginForm = Ext.extend(Ext.form.FormPanel,{
constructor:function(config){
var obj = this;
var default_options = {
title:'Login',
scroll: 'vertical',
url : '/accounts/',
standardSubmit : false,
items:[
{
xtype: 'fieldset',
title: 'Login/Register',
defaults: {
required: true,
labelAlign: 'left'
},
items: [
{
xtype:'textfield',
name:'email',
label:'Email',
placeHolder: 'you@domain.com'
},
new Ext.form.PasswordField({
name:'password',
label:'Password'
}),
{
xtype:'container',
layout:'hbox',
items:[
{
xtype:'button',
text:'Register',
handler:function(){
obj.setValues({
action:'register'
});
obj.submit({
waitMsg : {
message:'Submitting',
cls : 'demos-loading'
},
success:function(form,result){
alert('success');
},
failure:function(form,result){
alert('failure');
}
});
}
},
{
xtype:'spacer'
},
{
xtype:'button',
text:'Login',
handler:function(){
obj.setValues({
action:'login'
});
obj.submit({
waitMsg : {
message:'Submitting',
cls : 'demos-loading'
},
success:function(form,result){
alert('success');
},
failure:function(form,result){
alert('failure');
}
});
}
},
],
},
{
xtype:'hidden',
name:'action'
}
]
},
]
};
LoginForm.superclass.constructor.call(this, default_options);
}
});

Any help or input would be appreciated. Thanks!

evant
22 Sep 2010, 6:17 PM
They were added post 0.93, you'll need to upgrade.