PDA

View Full Version : form submit database



Olivier1980
24 Oct 2014, 7:55 AM
Hello,

I'm new to Sencha, and i've read a lot, how to do things, but i can't get a clue to it.

I want to make a form with multiple text fields.
and if those fields are filled, you can press a button submit, you send the filled field to a database.

How must i do this. i'm blanked out...

The code what i've have is:

Ext.define('MyDesktop.Modules.Meldkamert.Client.Meldkamert', {

extend: 'Ext.ux.desktop.Module',

id:'meldkamert-win',
init : function(){

this.launcher = {

text: 'Melding toevoegen',


iconCls:'icon-meldkamert',


handler : this.createWindow,


scope: this


};


},

createWindow : function(){


var desktop = this.app.getDesktop();


var win = desktop.getWindow('meldkamert-win');


if(!win){


win = desktop.createWindow({

loader: {
url: './modules/Aris/Client/index.php',
autoLoad: true,
loadMask: true,
contentType: 'html',
mode: 'iframe'
},
renderTo: Ext.getBody(),


id: 'meldkamert-win',


title:'Melding toevoegen',


width:1000,

height:600,


iconCls: 'icon-meldkamert',
frame:true,

fieldDefaults: {
msgTarget: 'side',
labelWidth: 75
},
defaultType: 'textfield',
defaults: {
anchor: '100%'
},

items: [{
fieldLabel: 'Username',
name: 'username',
allowBlank:false
},
{
inputType: 'hidden',
id: 'submitbutton',
name: 'myhiddenbutton',
value: 'hiddenvalue'
}

],
buttons: [{
text: 'Submit',
handler: function() {
simple.getForm().getEl().dom.action = '/modules/Aris/Client/olly.php';
simple.getForm().getEl().dom.method = 'POST';
simple.getForm().submit();
}
}],
animCollapse:false,


constrainHeader:true,


layout: 'fit'
})


}


win.show();


return win;


}


});


with kind regards

Olivier

scottmartin
28 Oct 2014, 5:42 AM
See the following example:
http://docs.sencha.com/extjs/4.2.3/#!/example/form/xml-form.html
http://docs.sencha.com/extjs/4.2.3/extjs-build/examples/form/xml-form.js