PDA

View Full Version : using load() to post data form a form



malkishua
24 Apr 2007, 11:54 AM
Hi,
i was looking at the dynamic form example and i was trying to do some authentication screen using that example, the problem is i jsut can get the load() to wrk and i keep getting "error object doesnt support this porperty or method"


var simple = new Ext.form.Form({
labelWidth: 75, // label settings here cascade unless overridden
url:'fgdfgfds.php',
style:'margin-top:20;',
reader : new Ext.data.XmlReader({
record : 'simple',
success: '@success'
}, [
'username', 'pass'
])
});
simple.add(
new Ext.form.TextField({
fieldLabel: 'Username',
name: 'username',
id: 'username',
width:175,
allowBlank:false
}),

new Ext.form.TextField({
fieldLabel: 'Password',
inputType: 'password',
name: 'pass',
width:175,
allowBlank:false
})
);

simple.column({width:100,hideLabels:true,style:'margin-left:10;margin-top:20;'},
new Ext.form.Checkbox({
name: 'rememebr',
boxLabel:'Remeber me'
})
);



simple.addButton('Login', function(){
simple.load({url:'test.php',
params: "username=" + Ext.get('username').dom.value,
text: "Updating..."
});
});


i might be going around this all wrong, but all i want is a simple way to post the data to php and update the UI if need be, or redirect.

Thanks.
Rob.

KRavEN
4 May 2007, 5:13 AM
Your params aren't setup right.

Should be:


simple.addButton('Login', function(){
simple.load({url:'test.php',
params:{username: Ext.get('username').dom.value,
text: "Updating..."}
});
});