Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
find('list') that displays blank (combobox)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
mario  
View profile  
 More options Sep 27 2008, 11:48 pm
From: mario <marioqta...@gmail.com>
Date: Sat, 27 Sep 2008 20:48:05 -0700 (PDT)
Local: Sat, Sep 27 2008 11:48 pm
Subject: find('list') that displays blank (combobox)
Hello everyone,

I'm creating a search page in my website and I want to take advantage
of cakephp's find('list') command.

Here is a snippet of my controller's code,

$collections = $this->Exhibit->Collection->find('list',
                                                                array(
                                                                        'order' => 'Collection.name ASC',
                                                                        'fields' => array('Collection.id', 'Collection.name')
                                                                ));
$this->set(compact('collections'));

Now in here, I want to generate a list of collections with their
corresponding id and name.

For my view,

I have this one:

<?php echo $form->input('collection_id', array('label'=> false)); ?>

As you can see, it will try to create a combobox based from my
collections list. My problem is that since i'm doing a search here, I
want to have a blank field display at the top most of my combobox
which find('list') can't seem to handle.

Please help.

Thanks,

Mario


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Adam Royle  
View profile  
 More options Sep 27 2008, 11:54 pm
From: Adam Royle <a...@sleekgeek.com.au>
Date: Sat, 27 Sep 2008 20:54:32 -0700 (PDT)
Local: Sat, Sep 27 2008 11:54 pm
Subject: Re: find('list') that displays blank (combobox)
<?php echo $form->input('collection_id', array('label'=> false,
'empty' => true)); ?>

or

<?php echo $form->input('collection_id', array('label'=> false,
'empty' => 'Please select...')); ?>

On Sep 28, 1:48 pm, mario <marioqta...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mario  
View profile  
 More options Sep 28 2008, 2:24 am
From: mario <marioqta...@gmail.com>
Date: Sat, 27 Sep 2008 23:24:41 -0700 (PDT)
Local: Sun, Sep 28 2008 2:24 am
Subject: Re: find('list') that displays blank (combobox)
Thanks a lot. I got it working now. =)

On Sep 27, 8:54 pm, Adam Royle <a...@sleekgeek.com.au> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google