Re: Form with saving of true/false/null

2009-08-29 Thread Dr. Loboto
null will become same as false, 0 and empty string on form submission. That's the problem. If these 3 states has so much sense I prefer to use string values: 'yes', 'no' and 'n/a' -- as cake inserts default value '0' and if it is allowed value not filled option will be considered as filled with '

Re: Form with saving of true/false/null

2009-08-28 Thread fabio
Hi, i'm a CakePHP newbie and i'm handling on a quite similar topic for which i've opened a specific thread here: http://groups.google.it/group/cake-php/browse_thread/thread/405946857d2f8ed3/8dbac8722596a58b Could you maybe have a look on it a give me some little help ? thanks a lot in advance for

Re: Form with saving of true/false/null

2009-08-01 Thread Antônio Marco
I would use delocalizer's idea just changing the $optarray to: ('0' => 'No', '1' => 'Yes', 'null' => 'No info') Good look. On Jul 31, 7:33 am, delocalizer wrote: > As for the coding, just use the form helper's automagic radio input: > eg > input('fieldname',array('type'=>'radio','options'=> >

Re: Form with saving of true/false/null

2009-07-31 Thread delocalizer
As for the coding, just use the form helper's automagic radio input: eg input('fieldname',array('type'=>'radio','options'=> $optarray)); ?> $optarray is the array of options, eg. array ('0'=>'No','1'=>'Yes','2'=>'No info') for the example you give. On Jul 31, 8:29 pm, delocalizer wrote: > The ot

Re: Form with saving of true/false/null

2009-07-31 Thread delocalizer
The other way you can approach clearing radio input groups is to add some little button or widget next to each group with a javascript onClick function that sets the values to empty. At least that's what I do. It looks prettier & and a bit more logical than an extra radio option. cheers, Conrad.

Re: Form with saving of true/false/null

2009-07-30 Thread Kanten
I have been giving this some thought and I do get what you mean, but it is very important that the user can always change e.g. an "yes" answer into "not info on subject". Database wise I think you are right, that I should define three different values (no = 0, yes = 1, no info = 2) instead of usin

Re: Form with saving of true/false/null

2009-07-30 Thread Kanten
I think I would prefer radio buttons, as I think these are easier to select then scroll downs when having to enter larger amount of data. Do you know how I can code this? /Anders On Jul 29, 4:40 pm, "rich...@home" wrote: > I'd use a drop down select instead of an option group. > > This should d

Re: Form with saving of true/false/null

2009-07-30 Thread delocalizer
You sure you want an explicit third option 'no information on the subject'? Wouldn't it be better to just have a radio group with 2 buttons (Yes/No or True/False) with a default value of NULL for that field in your database? Or if you really want to have a third option to force a user to enter som

Re: Form with saving of true/false/null

2009-07-29 Thread rich...@home
I'd use a drop down select instead of an option group. This should do the trick: input("Model.field", array("options"=>array(""=>"No information on subject", true=>"True", false=>"False))); ?> On Jul 29, 12:29 pm, Kanten wrote: > Is there really noone, that can help me with this one? > > Than

Re: Form with saving of true/false/null

2009-07-29 Thread Kanten
Is there really noone, that can help me with this one? Thanks Anders On Jul 10, 1:49 pm, Kanten wrote: > Hi, > > I am making a database for research and for this project I have a lot > of dichotomous (binary) variables where I need to be able to > discrimate between true, false and "no informat

Form with saving of true/false/null

2009-07-10 Thread Kanten
Hi, I am making a database for research and for this project I have a lot of dichotomous (binary) variables where I need to be able to discrimate between true, false and "no information on subject" (=null). I would like to store it as a bool field in MySQL. User interface wise I was thinking of u