-
29 Nov 2012 11:31 AM #1
checkbox not showing as parameter?
checkbox not showing as parameter?
I'm using an Ext.form.field.Checkbox on a form. Here's me creating it:
But on submission to my Java servlet, I don't see an "active" parameter. If I use a normal HTML checkbox it works.Code:var activeCheckbox = Ext.create('Ext.form.field.Checkbox', { id: 'detail-active', name: 'active', inputValue: 'x', uncheckedValue: 'y', fieldLabel: 'Active', labelAlign: 'top', submitValue: true })
One thing, I have the checkbox embedded in a panel, with date & time selectors. The servlet picks those up as parameters.
Looking at the generated source, I don't see name="active" attached to the ExtJS generated checkbox element, but I do with the date & time selector.
Anyway, not sure if I'm missing something. Any help appreciated!
-colin
-
1 Dec 2012 7:45 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,582
- Vote Rating
- 433
With this:
When I submit with it checked it sends active : x and when it's unchecked it sends active : y as expected for me.Code:new Ext.form.Panel({ renderTo : document.body, url : 'data/form.php', items : [ { xtype : 'checkbox', name : 'active', inputValue : 'x', uncheckedValue : 'y', fieldLabel : 'Active', labelAlign : 'top', submitValue : true }, { xtype : 'button', text : 'Submit', handler : function(btn) { var form = btn.up('form'); form.submit(); } } ] });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.


Reply With Quote