[Zope] <dtml-in item> iteration on INSERT method

Dieter Maurer dieter@handshake.de
Wed, 7 Mar 2001 22:56:14 +0100 (CET)


Paz writes:
 > I've used the <dtml-in item> iteration many times with dbms tables and ZSQL
 > methods, but always in context of an UPDATE table SET where clause....
 > What I WANT to do now is INSERT into table using the same item construction,
 > when a checkbox in a multiple record form is checked....
In principle, the construct should work the same for
"INSERT" as well as for "UPDATE".

Due to some HTML-weirdness, checkboxes are quite difficult
to handle. They are only "successful" (and included
in the form data set) when checked.
Unchecked, they are "unsuccessful" and the request
simply does not contain any trace of them.
This may cause "Bad request" errors from ZSQL methods.

There are several ways, how to work around this HTML bug (feature?):
all have to do with providing default values.
Maybe, the easiest (for a single checkbox) is to provide
a default value for the corresponding Z SQL argument.
You will find more methods in

  URL:http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html


Dieter