-
7 Jun 2012 3:48 AM #1
Form should not submit unnamed fields
Form should not submit unnamed fields
The docs for Ext.field.Field say:
However, a field with no name is still submitted: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
A field like this would result in "null=" being submitted when form.submit() is called.Code:... { xtype: "togglefield", label: "Existing chapters", labelWidth: null } ...
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.
-
9 Jun 2012 6:45 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
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.
So now the form.submit() will only get the fields with the name configured.Code:form.getValues() //return fields with name configured form.getValues(null, true) //return all fields
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-2992
in
a recent build.




Reply With Quote