cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Haul <>
Subject Re: SUMMARY: how to use a checkbox with DatabaseUpdateAction
Date Thu, 25 Jul 2002 15:32:36 GMT
On 25.Jul.2002 -- 03:31 PM, Simon Price wrote:
> I've come up with a code-free workaround for the problem.
> Quick reminder of the problem: HTML checkboxes do not submit a request 
> value if unchecked and hence DatabaseUpdateAction writes NULL into the 
> corresponding column in the database. In Cocoon 2.03 there in no way of 
> overriding this effective "NULL default".
> What is more typically required is something like: when checked, write 
> "Y"; when unchecked, write "N". By adding a hidden input field of the 
> same name as the checkbox input field to your HTML form you can force a 
> non-NULL default.

Sorry to disappoint you, but the above does not work reliably: If
multiple fields with the same name exist, it completely depends on the
client in what order they are sent.

So, you get two values and when using the getAttributeValues() method,
you'll get an array ['Y','N']

C h r i s t i a n       H a u l
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

Please check that your question  has not already been answered in the
FAQ before posting.     <>

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

View raw message