If you use the script.aculo.us autocompleter the option you need to
set is called tokens which takes either a string or an array of
strings to reset on.  Note: I haven't used autocompleter myself just
looked up the info.

On Mon, Aug 10, 2009 at 4:11 AM, Angeline<[email protected]> wrote:
>
> Hi, I have an auto complete box which is populated with the list of
> users of the application. It is working fine with the box listing the
> users.
>
> But I am able to select only one user. How to select multiple users
> from the list ?
> I am using the built-in auto complete feature of the CakePHP
> framework. But in order to select multiple entries, I think I must
> code the js separately, since the ajax helper in CakePHP does not
> support selecting multiple entries.  This is the action in the
> controller which generates the auto complete text box.
>
> function autoComplete()
> {
>  $this->set('users',$this->User->find('all',array(
>                                  'fields'=>array
> ('User.id','User.name'),
>    'conditions'=>array('User.name LIKE' => $this->data['User']
> ['name'].'%'))));
>
>    $this->layout = "ajax";
> }
>
> This is the auto_complete.ctp file
>
> <ul>
>    <?php foreach($users as $user): ?>
>         <li><?php echo $user['User']['name']; ?></li>
>    <?php endforeach; ?>
> </ul>
>
> And this is the view where I have the auto complete box:
>
> <?php echo $form->create('User', array('url' => '/forms/share')); ?>
>
>     <?php  echo $ajax->autoComplete('User.name', '/forms/
> autoComplete');?>
>
>  <?php echo $form->end('Share');?>
>
> In the auto complete box, I am able to select only one user name. how
> can I select multiple users with a comma or space separator?
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" 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/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to