PDA

View Full Version : form submit



wehtam
21 Aug 2007, 5:35 AM
Hello,
sorry for my very bad english.
I have a form like this :[CODE]<script language="javascript">
Ext.onReady(function(){

Ext.QuickTips.init();
// turn on validation errors beside the field globally
Ext.form.Field.prototype.msgTarget = 'under';
var simple = new Ext.form.Form({
labelWidth: 120, // label settings here cascade unless overridden
url:'addFonction.php'
});
simple.add(
new Ext.form.TextField({
fieldLabel: 'Identifiant',
name: 'login',
width:175,
allowBlank:false
}),

new Ext.form.TextField({
fieldLabel: 'Mot de passe',
name: 'pwd',
width:175,
allowBlank:false
})
);


simple.addButton('Valider', function(){
if (simple.isValid())
{
simple.submit({url:'ajaxLogin.php',
waitMsg:'Enregistrement des donn&eacute;es ...',
success:function(form, action){
alert(action);
//Ext.MessageBox.hide();
//Ext.MessageBox.alert('Acc

jay@moduscreate.com
21 Aug 2007, 5:47 AM
add a failure clause under your success :)

fay
21 Aug 2007, 5:56 AM
There's an example of doing this here: http://extjs.com/forum/showthread.php?p=54613#post54613

wehtam
21 Aug 2007, 5:59 AM
thanks !!!!!! :D:D:D
it's wooks

TheNakedPirate
23 Aug 2007, 8:29 PM
failure: function()
{
Ext.MessageBox.alert("Failure", "There was a problem submitting this item.");
}