[Zope] Passing the value of a checkbox from a form to a dtml-method

Tino Wildenhain tino@wildenhain.de
Wed, 02 May 2001 11:10:46 +0200


Hi Thomas,

--On Dienstag, 1. Mai 2001 11:34 -0400 "Thomas B. Passin" 
<tpassin@mitretek.org> wrote:

> [Casey Duncan]
>
>>
>> You could try this:
>>
>> <input type="hidden" name="isPublic:default" value="0">
>> <input type="checkbox" name="isPublic" value="1">
>>
>> If the checkbox is not checked, Zope will pass the default value in the
>> hidden field instead.
>>
>  But if it IS checked, I believe the form will contain a list of the two
> values, that is,
>
> isPublic=["0","1"]
>
> At least, it works like that if you have several check boxes of the same
> name.  So one way or another, somewhere you have to check the nature of
> the returned data.

There is a difference, its the ":default" modifier.
with it it works as described - if no value is
retuerned, zope uses this value instead.

Regards
Tino