Re: problem making a select box

2008-04-25 Thread b logica
One should get in the habit of always using single quotes unless there is a variable inside that should be parsed (and, if so, it should be wrapped with { and } to at least make it obvious). Using double quotes without variables is wasting parse cycles. On Fri, Apr 25, 2008 at 10:08 AM, seb <[EMA

Re: problem making a select box

2008-04-25 Thread rtanz
thanks alot guys everything clear now :) On Apr 25, 4:08 pm, seb <[EMAIL PROTECTED]> wrote: > rtanz wrote: > > cheers that worked perfectly, another thing while we're at it, i am > > noticing that the code works the same whether you use single or double > > quotes, is one or the other better? Sor

Re: problem making a select box

2008-04-25 Thread seb
rtanz wrote: > cheers that worked perfectly, another thing while we're at it, i am > noticing that the code works the same whether you use single or double > quotes, is one or the other better? Sorry might be a php thing and > nothing related to cake, im not an expert in php itself either. thanks

Re: problem making a select box

2008-04-25 Thread dr. Hannibal Lecter
Well, if you put double quotes, you then can put variables inside a string and they will be replaced by proper values. Single quoted strings are not parsed. I tend to use single quotes because it is supposedly a bit faster to process by the PHP parser. You can read more about these here: http:/

Re: problem making a select box

2008-04-25 Thread rtanz
cheers that worked perfectly, another thing while we're at it, i am noticing that the code works the same whether you use single or double quotes, is one or the other better? Sorry might be a php thing and nothing related to cake, im not an expert in php itself either. thanks On Apr 25, 3:52 pm,

Re: problem making a select box

2008-04-25 Thread dr. Hannibal Lecter
Have you tried this: echo $form->select('active', array('1' => 'Yes', '2' => 'No'), '1', array(), false); This should work for 1.2 On Apr 25, 11:28 am, rtanz <[EMAIL PROTECTED]> wrote: > hi i would like to make a select box with a label and dropdown, > default value 'Yes' and no empty value. I

Re: problem making a select box

2008-04-25 Thread seb
rtanz wrote: > tried that and got this error > > Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/jpgalea/ > public_html/survey/app/views/surveys/edit.ctp on line 9 Sorry for that, I should have done a cut & paste from my own code. Made a typo by forgetting to enclose all things re

Re: problem making a select box

2008-04-25 Thread rtanz
yes amit i used that syntax originally, but now i want to add those other options, i.e. I want Yes to be selected by default and I also dont want any blank fields. This is what I would like to achieve, so i need to add some more parameters... On Apr 25, 1:07 pm, "Amit Badkas" <[EMAIL PROTECTED]>

Re: problem making a select box

2008-04-25 Thread Amit Badkas
- You should use syntax like echo $form->select('active', array(0 => 'Yes', 1 => 'No')); On Fri, Apr 25, 2008 at 3:56 PM, rtanz <[EMAIL PROTECTED]> wrote: > > tried that and got this error > > Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/jpgalea/ > public_html/survey/app/views/su

Re: problem making a select box

2008-04-25 Thread rtanz
tried that and got this error Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/jpgalea/ public_html/survey/app/views/surveys/edit.ctp on line 9 On Apr 25, 12:08 pm, seb <[EMAIL PROTECTED]> wrote: > rtanz wrote: > > hi i would like to make a select box with a label and dropdown, > >

Re: problem making a select box

2008-04-25 Thread Amit Badkas
On Fri, Apr 25, 2008 at 2:58 PM, rtanz <[EMAIL PROTECTED]> wrote: > > hi i would like to make a select box with a label and dropdown, > default value 'Yes' and no empty value. I am trying this code but its > not working as i want to, can you help me out? > >echo $form- > >select('active',a

Re: problem making a select box

2008-04-25 Thread seb
rtanz wrote: > hi i would like to make a select box with a label and dropdown, > default value 'Yes' and no empty value. I am trying this code but its > not working as i want to, can you help me out? With Cake 1.2, you should try this : echo $form->input("type"=>"select","options"=>array("0"=>"