Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext User wceuppens's Avatar
    Join Date
    Dec 2009
    Posts
    54
    Vote Rating
    0
    wceuppens is on a distinguished road

      0  

    Default [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:
    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 } ]
    The post result that was expected:
    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)

  2. #2
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    I can't reproduce this.

  3. #3
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    how are you setting the form values? Can you see the hidden field in the DOM?

    It should look like:

  4. #4
    Ext User wceuppens's Avatar
    Join Date
    Dec 2009
    Posts
    54
    Vote Rating
    0
    wceuppens is on a distinguished road

      0  

    Default


    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} }) } };
    Attached Images
    Kind Regards,
    Willy. (Averell Dalton)

  5. #5
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,050
    Vote Rating
    657
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    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!

  6. #6
    Ext User wceuppens's Avatar
    Join Date
    Dec 2009
    Posts
    54
    Vote Rating
    0
    wceuppens is on a distinguished road

      0  

    Default 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)

Thread Participants: 2