PDA

View Full Version : login form kitchensink



Heho
15 Sep 2010, 11:29 PM
Hallo,

I have a problem with the "login form".
The buttons "submit" and "reset" in the form are not working.
And I dont know why?
thank you

Here is the source code, maybe there is something wrong.

demos.Forms = new Ext.form.FormPanel({
scroll: 'vertical',
renderTo: document.body,
frame: true,
items: [{
xtype: 'fieldset',
title: 'Login In',
width: 500,
items: [{
xtype: 'textfield',
name: 'logonname',
fieldLabel: 'Name',
allowBlank: false
},
{
fieldLabel: 'Password',
id: 'password',
name: 'password',
allowBlank: false,
xtype: 'textfield',
inputType: 'password',
minLengthText: 5,
minLengthText: 'Must be between 5-20 characters',
maxLengthText: 20,
maxLengthText: 'Must be between 5-20 characters'
},{
xtype: 'button',
text: 'Save',
handler: function(){
demos.Forms.getForm().submit({
success: function(f,a){
Ext.Msg.alert('Now you ', 'It Worked');
},
failure: function(f,a){
Ext.Msg.alert('Error', 'Warning');
}
}) ;
}
},{
xtype: 'button',
text: 'Reset',
handler: function(){
demos.Forms.getForm().reset();
}
}
]
}]});

Heho
16 Sep 2010, 12:05 AM
Here is the source code, maybe I have done something wrong.

demos.Forms = new Ext.form.FormPanel({
scroll: 'vertical',
renderTo: document.body,
frame: true,
items: [{
xtype: 'fieldset',
title: 'Login In',
width: 500,
items: [{
xtype: 'textfield',
name: 'logonname',
fieldLabel: 'Name',
allowBlank: false
},
{
fieldLabel: 'Password',
id: 'password',
name: 'password',
allowBlank: false,
xtype: 'textfield',
inputType: 'password',
/*vtype: 'password',*/
minLengthText: 5,
minLengthText: 'Must be between 5-20 characters',
maxLengthText: 20,
maxLengthText: 'Must be between 5-20 characters'

},{
xtype: 'button',
text: 'Save',
handler: function(){

demos.Forms.getForm().submit({
success: function(f,a){
Ext.Msg.alert('Now you ', 'It Worked');
},
failure: function(f,a){
Ext.Msg.alert('Error', 'Warning');
}
}) ;
}
},{
xtype: 'button',
text: 'Reset',
handler: function(){
demos.Forms.getForm().reset();
}
}
]
}]});