-
24 Jan 2010 8:26 AM #1
[CLOSED][3.1] hidden field does not get posted if it is the first form field
[CLOSED][3.1] hidden field does not get posted if it is the first form field
Ext version tested:
Ext 3.1 rev 0
Adapter used:
ext
Browser versions tested against:
FF3 (firebug 1.3.0.10 installed)
Operating System:
WinXP Pro
Description:
When a hidden field is the first field in a form, it does not get posted when the form is submitted.
Test Case:
The post result that was expected:Code:centre1.users.fields = [
{ name : 'id', xtype : 'hidden' }, { fieldLabel : centre1.users.lang.user, name : 'user', xtype : 'textfield', maskRe : /[a-z]/i, allowBlank : false, emptyText : centre1.users.lang.emptyField } ]
id 99
user danny
The post result that occurs instead:
user danny
What does work:
When I define the hidden field after the textfield, the hidden field is posted correctly.
Code that gives the expected result
Code:centre1.users.fields = [
{ fieldLabel : centre1.users.lang.user, name : 'user', xtype : 'textfield', maskRe : /[a-z]/i, allowBlank : false, emptyText : centre1.users.lang.emptyField }, { name : 'id', xtype : 'hidden' } ]Kind Regards,
Willy. (
Averell Dalton)
-
24 Jan 2010 9:34 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
I can't reproduce this.

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
24 Jan 2010 9:35 AM #3Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
how are you setting the form values? Can you see the hidden field in the DOM?
It should look like:

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
24 Jan 2010 9:49 PM #4
I have no problems reproducing AND the same problem occurs in IE8.
The hidden field appears in the dom (bug1)
The working example (with the hidden field after the first non-hidden) shows the following in the dom (bug2)
I'm loading the form from a database record and id is shown in the json data in both cases.
After changes, I'm submitting the form to update the changes and in the non-working case the hidden 'id' is not posted.
I'm submitting using this code:
Code:centre1.users.formButtonHandler = function(button) { if (button.iconCls == 'icon-cancel') { centre1.users.window.hide(); } else { // alert('button with class <' + button.iconCls + '> pressed.'); var action = button.iconCls.substring(5); centre1.users.form.getForm().submit({ url : 'php/base.centre1.users.users.php', success : function(){ centre1.users.store.reload(); centre1.users.window.hide(); }, // failure : <handler(form, action)>, params : {action: action} }) } };Kind Regards,
Willy. (
Averell Dalton)
-
24 Jan 2010 10:02 PM #5
What happens if you change the field name from id to something else?
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
24 Jan 2010 10:06 PM #6
MY MISTAKE: CONSIDER AS [SOLVED]
MY MISTAKE: CONSIDER AS [SOLVED]
Found MY mistake
, sorry to bother you:
I am using the same form for add, update and delete.
For update, I disabled the user field:
Code:for (i=0; i<centre1.users.form.items.length; i++) { if (from.iconCls == 'icon-add' || (from.iconCls == 'icon-updateUser' && i > 0)) { centre1.users.form.items.items[i].enable(); } else { centre1.users.form.items.items[i].disable(); } centre1.users.form.items.items[i].setRawValue(undefined); centre1.users.form.items.items[i].clearInvalid();}I added the hidden field afterwards, and the code above disabled not the user, but the hidden field.Kind Regards,
Willy. (
Averell Dalton)
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote