J
|
Jane 8/30/2006 |
Hi, |
T
|
thesofa 8/30/2006 |
I have just fired up the beta 3.1 and it is a lot more impressive than 3.0. A big difference. It seems to be a bit better than 3.0 as well (less bugs). I did wonder how to set the Checkbox values? ie how do you set what value in a field sets it checked and unchecked? It seems to be hardwired to 0=unchecked and 1=checked. This is certainly not much good if it is the case.
|
K
|
kneighbour author 8/30/2006 |
Are you trying to get the values saved as "Y" or "N", or "M" or "F" for example, rather than 0 or1?
|
F
|
fullfusion 9/25/2006 |
Well, in this case I am trying to set 1=unchecked and 0=checked, but it could be anything, as you suggest.
|
![]() |
mikue from germany 9/25/2006 |
Hi, |
![]() |
Sergey Kornilov admin 9/25/2006 |
You can use BeforeEdit event for this purpose. |
F
|
fullfusion 9/26/2006 |
You can use BeforeEdit event for this purpose. Something like this will work: function BeforeEdit(&$values, $where) { if ($values["Model"]=="1") $values["Model"]="Y"; else $values["Model"]="N"; return true; } This will write 'Y' and 'N' to the database instead of 1 and 0. The only problem is that checkbox control won't recognize 'Y' and 'N' as a valid input. Probably you can modify SQL query to convert Y and N back to 1 and 0 so checkboxes work fine.
|
J
|
Jane 9/27/2006 |
Hi, else if($format == FORMATCHECKBOX) { $ret="<img src=\"images/check"; if($data[$field] && $data[$field]!=0) $ret.="yes"; else $ret.="no"; $ret.=".gif\" border=0>"; }
else if($format == FORMAT_CHECKBOX) { if($data[$field] && $data[$field]!=0) $ret="yes"; else $ret="no"; } |