[Zope] Trying to get Form/Checkbox value into Python Script

Phil Harris phil.harris@zope.co.uk
29 Sep 2001 14:54:39 -0400


Ronald,

You're not doing anything wrong.  That's how HTML Forms work.

They only pass the value of a checkbox back to the server if it is
selected, omission means false.

you can get the correct value with something like:

cbvalue=context.REQUEST.get('cb','defaultValue') 

hth

Phil



On 29 Sep 2001 07:09:19 -0500, Ronald L. Chichester wrote:
> I've found the problem with getting data into a python script.  It is
> with the checkboxes.
> 
> If the checkbox is checked, the parameter is passed and the boolean
> property is set properly.
> 
> However, if the checkbox is unchecked, I get a Zope error indicating
> that the parameter was NOT passed.  Same form, same everything except in
> the test second test case the checkbox was unchecked.  In essense, it
> only passes the checkbox value when the checkbox is checked.  Does
> anyone know what I'm doing wrong?  How do you pass boolean values (i.e.,
> from checkboxes) to a python script when the box is unchecked?
> 
> Thanks,
> 
> Ron
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )