Magicbob
13 Sep 2007, 1:34 PM
Hello
I have a problem with the submission of a form.
The look is good but and everything seems to be ok but when i submit it, i have no values posted
I use a template to generate my form :
this.Formulaire_Template.overwrite(this.dlgEdition.body.id,this.Formulaire_Template_Labels);
I then create the form :
this.fs = new Ext.form.Form({
waitMsgTarget:Ext.get(this.Formulaire_Conteneur),
url:this.Formulaire_url_Validation,
scope: this,
labelSeparator: ' ',
reader: new Ext.data.JsonReader({root: 'record',successProperty: 'success'}, Ext.data.Record.create(this.Formulaire_Record_Datas))
});
I add the fields to the form and apply them to the template :
this.fs.add(new Ext.form.DateField({width:217,labelSeparator: ' ',name: 'internautes-internaute_date_naissance',menu: new YearIncrementableDateMenu(),allowBlank:false,blankText: _('internautes-erreur-date_naissance'),format:'d M Y'}).applyTo('internautes-internaute_date_naissance'));
this.fs.add(new Ext.form.ComboBox({width: 217,labelSeparator: ' ',name: 'internautes-id_ville',store: this.ds_villes,minChars: 1,editable: true,mode: 'remote', valueField: 'id_ville',displayField:'ville_majuscule',typeAhead: false,loadingText: _('internautes-recherche_ville'),hideTrigger:false,triggerAction: 'all',forceSelection: true,emptyText: _('internautes-selection_ville'),allowBlank:false,blankText: _('internautes-erreur-ville-vide'),selectOnFocus:false}).applyTo('internautes-id_ville'));
this.fs.add(new Ext.form.ComboBox({width: 217,labelSeparator: ' ',name: 'internautes-id_type_internaute',store: this.ds_types_internautes,editable: false,mode: 'remote', valueField: 'id_type_internaute',displayField:'type_internaute',typeAhead: false,loadingText: _('internautes-recherche_type_internaute'),hideTrigger:false,triggerAction: 'all',forceSelection: true,emptyText: _('internautes-selection_type_internaute'),allowBlank:false,blankText: _('internautes-erreur-type_internaute-vide'),selectOnFocus:false}).applyTo('internautes-id_type_internaute'));
this.fs.add(new Ext.form.TextFieldRemoteVal({width: 200,labelSeparator: ' ',name: 'internautes-internaute_pseudo',remoteValidation: 'onBlur',urlRemoteVal: 'php/internautes/controle_champs.php',paramsRemoteVal: {champs: 'internaute_pseudo'}}).applyTo('internautes-internaute_pseudo'));
this.fs.add(new Ext.form.TextFieldRemoteVal({width: 200,labelSeparator: ' ',name: 'internautes-internaute_nom',remoteValidation: 'onBlur',urlRemoteVal: 'php/internautes/controle_champs.php',paramsRemoteVal: {champs: 'internaute_nom'}}).applyTo('internautes-internaute_nom'));
this.fs.add(new Ext.form.TextFieldRemoteVal({width: 200,labelSeparator: ' ',name: 'internautes-internaute_prenom',remoteValidation: 'onBlur',urlRemoteVal: 'php/internautes/controle_champs.php',paramsRemoteVal: {champs: 'internaute_prenom'}}).applyTo('internautes-internaute_prenom'));
this.fs.add(new Ext.form.TextFieldRemoteVal({width: 200,labelSeparator: ' ',name: 'internautes-internaute_email',remoteValidation: 'onBlur',urlRemoteVal: 'php/internautes/controle_champs.php',paramsRemoteVal: {champs: 'internaute_email'}}).applyTo('internautes-internaute_email'));
this.fs.add(new Ext.form.TextFieldRemoteVal({width: 200,labelSeparator: ' ',name: 'internautes-internaute_password',name2: '',remoteValidation: 'onBlur',urlRemoteVal: 'php/internautes/controle_champs.php',paramsRemoteVal: {champs: 'internaute_password'}}).applyTo('internautes-internaute_password'));
this.fs.add(new Ext.form.TextFieldRemoteVal({width: 200,labelSeparator: ' ',name: 'internautes-internaute_telephone',remoteValidation: 'onBlur',urlRemoteVal: 'php/internautes/controle_champs.php',paramsRemoteVal: {champs: 'internaute_telephone'}}).applyTo('internautes-internaute_telephone'));
this.fs.add(new Ext.form.TextFieldRemoteVal({width: 200,labelSeparator: ' ',name: 'internautes-internaute_icq',remoteValidation: 'onBlur',urlRemoteVal: 'php/internautes/controle_champs.php',paramsRemoteVal: {champs: 'internaute_icq'}}).applyTo('internautes-internaute_icq'));
this.fs.add(new Ext.form.TextFieldRemoteVal({width: 200,labelSeparator: ' ',name: 'internautes-internaute_msn',remoteValidation: 'onBlur',urlRemoteVal: 'php/internautes/controle_champs.php',paramsRemoteVal: {champs: 'internaute_msn'}}).applyTo('internautes-internaute_msn'));
this.fs.add(new Ext.form.TextArea({width:200,labelSeparator: ' ',name: 'internautes-internaute_commentaire',grow: true,preventScrollbars:true}).applyTo('internautes-internaute_commentaire'));
this.fs.add(new Ext.form.TextArea({width:200,labelSeparator: ' ',name: 'internautes-internaute_adresse',grow: true,preventScrollbars:true}).applyTo('internautes-internaute_adresse'));
I render the form :
this.fs.load({
url:this.Datastore_url,
method: 'POST',
params: {isform: true,id: this.grid.getSelectionModel().getSelected().id,prefix: this.Prefix},
waitMsg:'Chargement des donnees...',
success: this.EditionChargementOk,
failure: this.EditionChargementProblem,
scope: this
});
this.fs.end();
this.fs.render(this.Formulaire_Name);
and here is the submit part :
options = {
method: 'POST',
scope:this,
waitMsg:'Inscription en cours...',
success: function(formulaire, action) {
this.dlgEdition.hide();
Ext.Msg.alert('Inscription', _("inscription-reussie"));
},
failure: function(formulaire, action) {
Ext.Msg.alert('Inscription', _("inscription-erreur-probleme"));
}
};
this.fs.submit(options);
When i submit the form , the values of field are not posted. Could someone help me?
Thanks
Magicbob
I have a problem with the submission of a form.
The look is good but and everything seems to be ok but when i submit it, i have no values posted
I use a template to generate my form :
this.Formulaire_Template.overwrite(this.dlgEdition.body.id,this.Formulaire_Template_Labels);
I then create the form :
this.fs = new Ext.form.Form({
waitMsgTarget:Ext.get(this.Formulaire_Conteneur),
url:this.Formulaire_url_Validation,
scope: this,
labelSeparator: ' ',
reader: new Ext.data.JsonReader({root: 'record',successProperty: 'success'}, Ext.data.Record.create(this.Formulaire_Record_Datas))
});
I add the fields to the form and apply them to the template :
this.fs.add(new Ext.form.DateField({width:217,labelSeparator: ' ',name: 'internautes-internaute_date_naissance',menu: new YearIncrementableDateMenu(),allowBlank:false,blankText: _('internautes-erreur-date_naissance'),format:'d M Y'}).applyTo('internautes-internaute_date_naissance'));
this.fs.add(new Ext.form.ComboBox({width: 217,labelSeparator: ' ',name: 'internautes-id_ville',store: this.ds_villes,minChars: 1,editable: true,mode: 'remote', valueField: 'id_ville',displayField:'ville_majuscule',typeAhead: false,loadingText: _('internautes-recherche_ville'),hideTrigger:false,triggerAction: 'all',forceSelection: true,emptyText: _('internautes-selection_ville'),allowBlank:false,blankText: _('internautes-erreur-ville-vide'),selectOnFocus:false}).applyTo('internautes-id_ville'));
this.fs.add(new Ext.form.ComboBox({width: 217,labelSeparator: ' ',name: 'internautes-id_type_internaute',store: this.ds_types_internautes,editable: false,mode: 'remote', valueField: 'id_type_internaute',displayField:'type_internaute',typeAhead: false,loadingText: _('internautes-recherche_type_internaute'),hideTrigger:false,triggerAction: 'all',forceSelection: true,emptyText: _('internautes-selection_type_internaute'),allowBlank:false,blankText: _('internautes-erreur-type_internaute-vide'),selectOnFocus:false}).applyTo('internautes-id_type_internaute'));
this.fs.add(new Ext.form.TextFieldRemoteVal({width: 200,labelSeparator: ' ',name: 'internautes-internaute_pseudo',remoteValidation: 'onBlur',urlRemoteVal: 'php/internautes/controle_champs.php',paramsRemoteVal: {champs: 'internaute_pseudo'}}).applyTo('internautes-internaute_pseudo'));
this.fs.add(new Ext.form.TextFieldRemoteVal({width: 200,labelSeparator: ' ',name: 'internautes-internaute_nom',remoteValidation: 'onBlur',urlRemoteVal: 'php/internautes/controle_champs.php',paramsRemoteVal: {champs: 'internaute_nom'}}).applyTo('internautes-internaute_nom'));
this.fs.add(new Ext.form.TextFieldRemoteVal({width: 200,labelSeparator: ' ',name: 'internautes-internaute_prenom',remoteValidation: 'onBlur',urlRemoteVal: 'php/internautes/controle_champs.php',paramsRemoteVal: {champs: 'internaute_prenom'}}).applyTo('internautes-internaute_prenom'));
this.fs.add(new Ext.form.TextFieldRemoteVal({width: 200,labelSeparator: ' ',name: 'internautes-internaute_email',remoteValidation: 'onBlur',urlRemoteVal: 'php/internautes/controle_champs.php',paramsRemoteVal: {champs: 'internaute_email'}}).applyTo('internautes-internaute_email'));
this.fs.add(new Ext.form.TextFieldRemoteVal({width: 200,labelSeparator: ' ',name: 'internautes-internaute_password',name2: '',remoteValidation: 'onBlur',urlRemoteVal: 'php/internautes/controle_champs.php',paramsRemoteVal: {champs: 'internaute_password'}}).applyTo('internautes-internaute_password'));
this.fs.add(new Ext.form.TextFieldRemoteVal({width: 200,labelSeparator: ' ',name: 'internautes-internaute_telephone',remoteValidation: 'onBlur',urlRemoteVal: 'php/internautes/controle_champs.php',paramsRemoteVal: {champs: 'internaute_telephone'}}).applyTo('internautes-internaute_telephone'));
this.fs.add(new Ext.form.TextFieldRemoteVal({width: 200,labelSeparator: ' ',name: 'internautes-internaute_icq',remoteValidation: 'onBlur',urlRemoteVal: 'php/internautes/controle_champs.php',paramsRemoteVal: {champs: 'internaute_icq'}}).applyTo('internautes-internaute_icq'));
this.fs.add(new Ext.form.TextFieldRemoteVal({width: 200,labelSeparator: ' ',name: 'internautes-internaute_msn',remoteValidation: 'onBlur',urlRemoteVal: 'php/internautes/controle_champs.php',paramsRemoteVal: {champs: 'internaute_msn'}}).applyTo('internautes-internaute_msn'));
this.fs.add(new Ext.form.TextArea({width:200,labelSeparator: ' ',name: 'internautes-internaute_commentaire',grow: true,preventScrollbars:true}).applyTo('internautes-internaute_commentaire'));
this.fs.add(new Ext.form.TextArea({width:200,labelSeparator: ' ',name: 'internautes-internaute_adresse',grow: true,preventScrollbars:true}).applyTo('internautes-internaute_adresse'));
I render the form :
this.fs.load({
url:this.Datastore_url,
method: 'POST',
params: {isform: true,id: this.grid.getSelectionModel().getSelected().id,prefix: this.Prefix},
waitMsg:'Chargement des donnees...',
success: this.EditionChargementOk,
failure: this.EditionChargementProblem,
scope: this
});
this.fs.end();
this.fs.render(this.Formulaire_Name);
and here is the submit part :
options = {
method: 'POST',
scope:this,
waitMsg:'Inscription en cours...',
success: function(formulaire, action) {
this.dlgEdition.hide();
Ext.Msg.alert('Inscription', _("inscription-reussie"));
},
failure: function(formulaire, action) {
Ext.Msg.alert('Inscription', _("inscription-erreur-probleme"));
}
};
this.fs.submit(options);
When i submit the form , the values of field are not posted. Could someone help me?
Thanks
Magicbob