Hi, I''ve a boolean database field (tinyint(1)) wich allows nulls. Then, I''ve something like this: radio_button(''server'',''customer_has_login'',"NULL") radio_button(''server'',''customer_has_login'',true) radio_button(''server'',''customer_has_login'',false) The problem is with the 1st radio_button, it doesn''t store a null. I''ve tried with no luck: radio_button(''server'',''customer_has_login'',"nil") and radio_button(''server'',''customer_has_login'',nil) no way..... any idea??? is possible?? Thanks.
Hi Matias, Matias wrote:> Hi, I''ve a boolean database field (tinyint(1)) wich allows > nulls. > > Then, I''ve something like this: > radio_button(''server'',''customer_has_login'',"NULL") > radio_button(''server'',''customer_has_login'',true) > radio_button(''server'',''customer_has_login'',false) > > The problem is with the 1st radio_button, it doesn''t store a null. > I''ve tried with no luck:>From a human factors perspective, it makes no sense to present a user withan option to select from true, false, or NULL. From a CS perspective, booleans are for two-option choices, not three-option choices. You haven''t said what you''re trying to accomplish, so I''m guessing here, but if you want to set the initial value to NULL you''d do it in your database definition. If you''re looking for something else, like trying to allow the user to tell you "I don''t know", then change your field definition to varchar(7) and put ''true'', ''false'', or ''unknown'' in it. hth, Bill
Thanks, I think I''m going to change the column type to char(1) and use simple characters instead. Thanks.> Hi Matias, > > Matias wrote: > >> Hi, I''ve a boolean database field (tinyint(1)) wich allows >> nulls. >> >> Then, I''ve something like this: >> radio_button(''server'',''customer_has_login'',"NULL") >> radio_button(''server'',''customer_has_login'',true) >> radio_button(''server'',''customer_has_login'',false) >> >> The problem is with the 1st radio_button, it doesn''t store a null. >> I''ve tried with no luck: > >>From a human factors perspective, it makes no sense to present a user with > an option to select from true, false, or NULL. From a CS perspective, > booleans are for two-option choices, not three-option choices. You > haven''t said what you''re trying to accomplish, so I''m guessing here, but > if you want to set the initial value to NULL you''d do it in your database > definition. If you''re looking for something else, like trying to allow the > user to tell you "I don''t know", then change your field definition to > varchar(7) and put ''true'', ''false'', or ''unknown'' in it. > > hth, > Bill