cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard R. McKinley" <>
Subject Re: More HTML than Cocoon but...
Date Thu, 28 Aug 2003 15:50:08 GMT
Mariusz Sieraczkiewicz wrote:

>Why? When updating database table, the field
>(bool_field for example)
>should be set 0 when false and 1 when true.
>I use DatabaseAction to do it autamatically,
>but when checkbox is unchecked the HTTP request
>doesn't contain bool_field entry.
>The code like
><input type=checkbox name=sth value=1>
>sets only 'checked value'.
That's the rub.  You can use some fancy methods such as JavaScript, but 
if you want to make things really easy do one of these two suggestions.  
Use radio buttons instead of check boxes.  Or if you do use check boxes 
then just have you logical interpretation match the visual 
representation more closely.  That is to say, if a check box is a 
boolean then have your conditions check for a value (any value, not just 
1, because it doesn't matter) or non-existence or what we call null.  If 
you don't check the box, then visualize the box as not being sent.  
*Check for the existence of the parameter, not its value*.  Of, course 
this applies only to check boxes.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message