Re: Blank "select" field/FromCGI

[prev] [thread] [next] [Date index for 2004/09/11]

From: Clayton Scott
Subject: Re: Blank "select" field/FromCGI
Date: 17:25 on 11 Sep 2004
Jesse Sheidlower wrote:

>So, what do I need to do to ensure that nothing is inserted
>into these columns when the select fields are blank?
>
>I'm sure this is something really obvious, and probably not
>related to CDBI, but it's probably also something that people
>need to do with CDBI, so I'd be grateful for any advice.
>
>  
>

In your CDBI sub-class for the table you probably want to have a
before_create trigger that checks the value of format and changes it 
from "" to undef.
What might be useful here is to to specify an explicit value instead of 
an empty option.
e.g. <option value='undef'>No Format</option>

Clayton

Blank "select" field/FromCGI
Jesse Sheidlower 17:16 on 11 Sep 2004

Re: Blank "select" field/FromCGI
Clayton Scott 17:25 on 11 Sep 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52