I'm trying with this code and can not find the error

<?php $this->Js->buffer(
 $('city.nombre').autocomplete({
  source: "/cities/autocomplete",
 }); ?>


On 11 abr, 09:35, Jens Dittrich <[email protected]> wrote:
> Actually it is really simple. You need to have the 
> jQueryUIautocompletelibrary in your applications js folder (webroot/js),
> without that, it won't work. In the view you only need a few lines of
> code like:
>
> $this->Js->buffer(
>  '$("ID_OF_THE_AUTOCOMPLETE_INPUT").autocomplete({
>   source: "/CONTROLLER/AUTOCOMPLETE_ACTION",
>  });
> );
>
> Implementan action that does fetch the data forautocompletein your
> controller do:
> 1. check that the request isAjax()
> 2. fetch the data your want in yourautocompletefield.
> 3. set the data for the view (in my case I made an extra view since
> the jQuery-Autocompleter expects JSON-encoded data.
> 4. in the view, do an $this->Js->object(DATA_TO_ENCODE); so the data
> is as expected.
>
> That's it.
>
> On 11 Apr., 05:21, tubiz <[email protected]> wrote:
>
>
>
>
>
>
>
> > Please I have been trying toimplementtheAJAXautocompletefound in
> > the Cakephp 1.3 cookbook but I havent gotten it to work.
>
> > There is a artist table in my database and I would like toimplement
> >autocompletefor a field in the Submit action in the Lyrics controller
>
> > Theautocompletewill be getting the name of artist in the artist
> > controller and displaying it in a text field in the Lyrics controller.
>
> > Would like to know how to do this and would theautocompleteaction be
> > in the artist controller or in the lyrics controller.
>
> > Thanks.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to