Results 1 to 2 of 2

Thread: checkbox not showing as parameter?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Nov 2012
    Vote Rating

    Default checkbox not showing as parameter?

    I'm using an Ext.form.field.Checkbox on a form. Here's me creating it:
        var activeCheckbox = Ext.create('Ext.form.field.Checkbox', {
            id: 'detail-active',
            name: 'active',
            inputValue: 'x',
            uncheckedValue: 'y',
            fieldLabel: 'Active',
            labelAlign: 'top',
            submitValue: true
    But on submission to my Java servlet, I don't see an "active" parameter. If I use a normal HTML checkbox it works.

    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!


  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


    With this:

    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');
    When I submit with it checked it sends active : x and when it's unchecked it sends active : y as expected for me.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2

    Think my support is good? Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Posting Permissions

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