-
27 Sep 2012 1:22 AM #1
Unanswered: Submit form: value of radio-field
Unanswered: Submit form: value of radio-field
Hello,
I've defined form with a radio-field in a vbox container, like this:
When I submit the form the value of the radio-field in the URL is always set to "on", where I would expect the value of the selected radio-button. The form is submitted like this:Code:flex: 2, xtype: 'formpanel', id: 'channel', scrollable: 'vertical', items: [ { xtype: 'radiofield', name : 'channel', value: 'direct', label: 'Direct', checked: true }, { xtype: 'radiofield', name : 'channel', value: 'indirect', label: 'Indirect' } ]
The URL in de browsers address bar resolves to http://myurl?channel=on.Code:var form = Ext.getCmp('channel'); form.setStandardSubmit(true); var val = form.getValues(); alert (val.channel); form.submit({ url: 'http://myurl', waitMsg: 'Sending...', method: 'GET', success: function() { alert('form submitted successfully!'); } });
The alert shows the correct value of the radio field. For text-fields the values in the URL look ok.
What is the correct way to submit the value of the radio-field?
-
29 Sep 2012 8:05 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
- Answers
- 3161
This works if you do not use standardSubmit, looks like there is a bug.
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.
-
20 Nov 2012 9:58 AM #3
Doesn't work even without standardSubmit
Doesn't work even without standardSubmit
Doesn't work even without standardSubmit. I cannot get any value on submit other than <radioname> = on. Please advise, thanks!
-
20 Nov 2012 10:03 AM #4
More info
More info
Doesn't work even without standardSubmit. I cannot get any value on submit other than <radioname> = on. Please advise, thanks!]
Syntax:
form.submit({
success: function(form, action) {
Ext.Msg.alert('Success', action.result.msg);
},
failure: function(form, action) {
Ext.Msg.alert('Failed', action.result.msg);
}
});


Reply With Quote