Martin
Martin

Reputation: 4222

Why checkfield sends 'on' and not 'true' to the server | Extjs

I have a form with bunch of fields and checkfield:

            {
                xtype: 'checkboxfield',
                fieldLabel: 'Approved?',
                name: 'user[approved]',
                value: usersShowStore.getData().items[0].data.approved,
            }, 

And so if checkbox selected in request parameters approved value is 'on'.

Started PUT "/users/3" for 127.0.0.1 at 2016-03-03 16:33:49 +0200
Processing by UsersController#update as */*
Parameters: {"user"=>{"first_name"=>"Test", "last_name"=>"Admin", "approved"=>"on", ...}

How to change checkbox default behavior to send boolean values?

Upvotes: 1

Views: 58

Answers (1)

CD..
CD..

Reputation: 74176

That is the default inputValue:

The value that should go into the generated input element's value attribute and should be used as the parameter value when submitting as part of a form.

Defaults to: 'on'

Upvotes: 3

Related Questions