function loadFormInscription() { var formInscription = new Ext.form.FormPanel({ standardSubmit: true, border:false, frame:false, monitorValid:true, labelAlign: 'right', bodyStyle: "padding: 5px;background-color: transparent; color: white;", defaultType: 'textfield', items: [ { fieldLabel: 'Prénom ', name: 'prenom', allowBlank:false, regex: prenomExpr, regexText: 'Le prénom ne doit pas dépasser 20 caractères', blankText: 'Prénom obligatoire' }, { fieldLabel: 'Nom ', name: 'nom', allowBlank:false, blankText: 'Nom obligatoire', regex: nomExpr, regexText: 'Le nom ne doit pas dépasser 30 caractères', blankText: 'Nom obligatoire' }, { fieldLabel: 'Email ', name: 'email', id: 'email', allowBlank:false, regex: emailExpr, emptyText: 'votre email', regexText: 'Format attendu : "user@domain.com"', blankText: 'Email obligatoire' }, { fieldLabel: 'Téléphone ', name: 'tel1', id: 'tel1', allowBlank:false, regex: telExpr, emptyText: 'N° pour vous contacter', blankText: 'Téléphone' }, { inputType: 'password', fieldLabel: 'Mot de passe ', name: 'pass', id: 'pass', allowBlank:false, regex: passwordExpr, regexText: 'Format attendu : minimum 8 lettres/chiffres', blankText: 'Mot de passe obligatoire' }, { inputType: 'password', fieldLabel: 'Confirmation ', name: 'pass-confirm', id: 'pass-confirm', allowBlank:false, regex: passwordExpr, regexText: 'Format attendu : 8 lettres/chiffres minimum', blankText: 'Confirmation obligatoire', initialPassField: 'pass' // id of the initial password field }, new Ext.form.RadioGroup({ fieldLabel: 'Je suis ', columns:1, allowBlank:false, cls:'xradiogroup', width: 200, items: [ { boxLabel: 'un homme', name: 'genre', inputValue: 'H' }, { boxLabel: 'une femme', name: 'genre', inputValue: 'F' } ] }), comboVilleCP, { inputType: 'hidden', id: 'encodedResponse', name: 'encodedResponse', value: '1' } ], buttons: [{ text: 'Inscription', formBind:true, scope:this, style:'position:relative;right:100px', handler: function() { var str = Ext.getCmp('email').getValue()+"*"+Ext.getCmp('pass').getValue(); Ext.getCmp('encodedResponse').setValue(MD5(str)); formInscription.getForm().getEl().dom.action = '/inscription.do'; formInscription.getForm().getEl().dom.method = 'POST'; formInscription.getForm().submit(); } }] }); formInscription.render('formInscription'); }