[Zope] Problem: form-checkbox -> MySQL-table

Richard Wesley hawkfish@electricfish.com
Mon, 22 Jul 2002 08:03:45 -0700

At 1:35 PM +0200 7/22/02, Thomas Weholt wrote:
>I got a MySQL-table with lots of "boolean"-values, in the form of
>ENUM('Y',N'). In my webpage I got a bunch of checkboxes and I want to map
>the checkboxes to the fields in the table. The problem is that a
>checkbox-value is only available if the checkbox has been checked. I've
>tried using <dtml-if fieldname> in my sql to check for the presence of a
>checked checkbox, add it to the columns-list and value-list if present, but
>I get an error " Error Value : 1136, "Column count doesn't match value count
>at row 1". That would be ok, if I could just see the SQL-statement that
>didn't work.
>In short : how can I post a bunch of boolean-like values from a form to a
>sql-method using MySQL?

I found that putting a hidden input value above the checkbox with the 
"off" value solved this problem for ZPT.  Won't work for multiple 
records because the two inputs will generate two records, so it there 
is a better ZPT method. I'd like to hear about it.

Richard Wesley
Co-President, Electric Fish, Inc.
(v) +1-206-493-1690x210
(f) +1-206-493-1697