[Solar-talk] disabled bool form elements

Jeff Surgeson solar at 3hex.com
Thu Aug 24 07:35:52 PDT 2006


Hi Paul

This appears strange to me as I see no logical reason for it, mayby you can 
but I think it is a small bug.

To create my bug:

In my data model I have two col's (amongst others), a drop down list and a 
checkbox as described below.

// user role
$this->_col['user_role'] = array(
    'type'    => 'varchar',
    'size'    => 32,
    'require' => true,
    'default'   => 'User',
    'valid' => array('inList', 'VALID_LIST', array('Admin', 'User')),
);

// include
$this->_col['include'] = array(
    'type'      => 'bool',
    'size'      => 1,
    'require'   => true,
    'default'   => 1,
);

In my form create function  these two elements are disabled.

Now all works fine, the data entry form is created as expected with these two 
elements disabled (greyed out) with the default values. 

On save() the record is created and saved as expected no problems with one 
small irritation.

Even though these are both disabled the drop down list saves the default 
value "User"  but the bool checkbox value remains as false (0)

If I force the value to true before save with it disabled it saves the default 
value.

My question is why does the bool type not respect the default value when 
disabled but other col types do?

-- 
Jeff Surgeson / South Africa


More information about the solar-talk mailing list