PDA

View Full Version : Doubt in the ExtJs



phanikumar121
3 Mar 2010, 6:03 AM
I had downloaded one simple ExtJs example from the below link.

http://www.roseindia.net/ajax/ext/ext-form.shtml


This is the code for register.js

Ext.onReady(function(){

var simple = new Ext.form.FormPanel({


standardSubmit: true,


frame:true,
title: 'Register',

width: 350,
defaults: {width: 230},
defaultType: 'textfield',
items: [{
fieldLabel: 'Username',
name: 'username',
id: 'username',
allowBlank:false
},
{
fieldLabel: 'Password',
name: 'password',
inputType:'password',
allowBlank:false
},

{
fieldLabel: 'First Name',
name: 'firstname',
inputType:'text',
allowBlank:false
},
{
fieldLabel: 'Last Name',
name: 'lastname',
inputType:'text',
allowBlank:false
},
{
fieldLabel: 'E-Mail Address',
name: 'email',
vtype:'email',

allowBlank:false
},

{
fieldLabel: 'State',
name: 'state',
allowBlank:false
},
{
fieldLabel: 'City',
name: 'city',
allowBlank:false
},
{
fieldLabel: 'Country',
name: 'country',
allowBlank:false
},
{
inputType: 'hidden',
id: 'submitbutton',
name: 'myhiddenbutton',
value: 'hiddenvalue'
}

],
buttons: [{
text: 'Submit',
handler: function() {
simple.getForm().getEl().dom.action = 'register';
simple.getForm().getEl().dom.method = 'POST';
simple.getForm().submit();
}
}]





});



simple.render('mydiv');



});


The code is executing correctly. But my doubt is they are submitting the page inside the register.js page itself. But I want to submit the form inside the register.html instead of register.js. Can I know the solution for the above problem....


Thanks in advance.....

TheMonolith
3 Mar 2010, 6:36 AM
You should format your code properly if you ever want to get help.
And making the entire post bold doesn't increase readability.

httpdotcom
3 Mar 2010, 7:24 AM
You never supplied a URL to post to inside of your form, or in the submit() method. In standard HTML, that would default to submitting to the current page.

Debug in Firebug to see where the form is posting to on submit().