Forum /
Ext JS Community Forums 3.x /
Ext 3.x: Help & Discussion /
Doubt in the ExtJs
Doubt in the ExtJs
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.....
You should format your code properly if you ever want to get help.
And making the entire post bold doesn't increase readability.
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().
Sencha is used by over two million developers. Join the community, wherever you’d like that community to be
or Join Us