Results 1 to 2 of 2

Thread: Form should not submit unnamed fields

    Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-2992 in a recent build.
  1. #1
    Sencha User aatiis's Avatar
    Join Date
    Nov 2011
    Bajmok, Serbia
    Vote Rating

    Default Form should not submit unnamed fields

    The docs for Ext.field.Field say:

    name : StringThe field's HTML name attribute. Note: this property must be set if this field is to be automatically included with form submit().

    Defaults to: null
    However, a field with no name is still submitted:

        xtype: "togglefield",    label: "Existing chapters",
        labelWidth: null
    A field like this would result in "null=" being submitted when form.submit() is called.

    A workaround is to use form.submit({params: ...}), or to disable the field in question before submitting the form.

    Please either clarify this in the docs if this is expected behaviour, or fix if this is a bug.

  2. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


    I'd consider this a bug as I agree with the docs.

    I have put in a fix where getValues() will only return the values of fields with the name configured but you can override it by passing true as the second argument.

    form.getValues() //return fields with name configured
    form.getValues(null, true) //return all fields
    So now the form.submit() will only get the fields with the name configured.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts