Code:
var combo = new Ext.form.ComboBox({
fieldLabel: 'gender',
hiddenName:'gender',
store: new Ext.data.SimpleStore({
fields: ['gender', 'genderName'],
data : Ext.exampledata.gender // from states.js
}),
valueField:'gender',
displayField:'genderName',
typeAhead: false,
mode: 'local',
triggerAction: 'all',
emptyText:'Select a gender...',
selectOnFocus:true,
orceSelection:true,
editable:false,
width:190
});
var login = new Ext.form.FormPanel({
labelWidth: 75,
title: 'Login to Bank',
bodyStyle:'padding:15px',
baseCls: 'x-plain',
url:'save-form.php',
width: 450,
height:300,
labelPad: 10,
items:[{
xtype:'tabpanel',
activeTab: 0,
defaults:{autoHeight:true, bodyStyle:'padding:10px'},
items:[{
title:'Login',
layout:'form',
defaultType: 'textfield',
items: [{
fieldLabel: 'UserName',
name: 'username',
allowBlank:false
},{
fieldLabel: 'Password',
inputType: 'password',
name: 'password',
allowBlank:false
}]
}]
}] ,
buttons: [{
text: 'login'
}]
});
var frm = new Ext.form.FormPanel({
labelWidth: 125,
title: 'Register Client',
method: 'POST',
bodyStyle:'padding:15px',
success:function(form, action){Ext.MessageBox.alert('Info3', action.result.results.test)},
height:400,
action:'servlet/Server.Register',
frame:true,
width: 350,
labelPad: 10,
items: {
xtype:'tabpanel',
activeTab: 0,
defaults:{autoHeight:true, bodyStyle:'padding:10px'},
items:[{
title:'Personal Details',
layout:'form',
defaultType: 'textfield',
items: [{
fieldLabel: 'First Name',
name: 'first',
allowBlank:false
},{
fieldLabel: 'Last Name',
name: 'last',
allowBlank:false
},{
fieldLabel: 'Company',
name: 'company'
},combo]
},{
title:'User Details',
layout:'form',
defaults: {width: 150},
defaultType: 'textfield',
items: [{
fieldLabel: 'UserName',
name: 'user',
allowBlank:false
},{
fieldLabel: 'Password',
name: 'pass',
id: 'pass',
// validator: checkPasswords,
allowBlank:false
},{
fieldLabel: 'Password Conform',
name: 'pass_conf',
id: 'pass_conf',
// validator: checkPasswords,
allowBlank:false
}, {
fieldLabel: 'Email',
name: 'email',
vtype:'email',
allowBlank:false
}]
},
{
title:'Phone Numbers',
layout:'form',
defaults: {width: 150},
defaultType: 'textfield',
items: [{
fieldLabel: 'Home',
name: 'home',
allowBlank:false
},{
fieldLabel: 'Business',
name: 'business'
},{
fieldLabel: 'Mobile',
name: 'mobile',
allowBlank:false
},{
fieldLabel: 'Fax',
name: 'fax'
}]
}]
}
});
frm.addButton('Submit', function(){
text: 'Register',
frm.getForm().submit({
waitMsg:'Please Wait...',
success:function(form, action){
Ext.MessageBox.hide();
Ext.MessageBox.alert('Success', action.result.results.test);
window.location = "interface.php";
},
// callback handler if submit has failed
failure: function(form, action) {
Ext.MessageBox.hide();
Ext.MessageBox.alert('Failure', action.result.results.success);
},
//params : { login:'login' } // I don't know what I'm suppose to do there
});
}, frm);
ok i have try many ways what i return is :