The 6th parameter of HtmlHelper::selectTag() is $showEmpty - set to
true by default. Set it to false and you won't get a blank entry.
If your options are going to be like that in the finished product then
you might want to do it like this:
<?php
$options = array('Biblical Coach Academy', 'CACC', 'Christian Coaches
Network', ...);
echo $html->selectTag('User/where', array_combine($options, $options),
null, null, null, false);
?>
It makes it a bit more readable, and if you need to change an item you
only have to type it once!
grigri
On 21 May, 03:26, rocky <[EMAIL PROTECTED]> wrote:
> Hey,
>
> I'm using below code to generate a selection box.
>
> --------------------Code begin------------------------
> <?php echo $html->selectTag('User/where', array('Biblical Coach
> Academy'=>'Bibli
> cal Coach Academy','CACC'=>'CACC','Christian Coaches
> Network'=>'Christian Coache
> s Network','Coaching Conference'=>'Coaching
> Conference','ILCT'=>'ILCT','PCCA'=>'
> PCCA','Search Engine'=>'Search Engine','Friend or referral'=>'Friend
> or referral
> '))?>
> ------------------Code end-------------------------------
>
> But instead of filled with 'Biblical Coach Academy', I got a blank
> item. Can any of you how to get rid of the blank item please?
>
> Blessings,
> Rocky
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---