I tried the ajax autocomplete manual.
http://book.cakephp.org/it/view/1370/autoComplete

*PROBLEM:*

   1. I can't seem to query $this->data['q'];
   2. Therefore, the auto complete list shows, everything. And not the
   specific keyword or "q" value.

How will I query $this->data['q'];? I think, I followed everything. What
seems to be wrong?

The codes:

*Added my controller*

function autocompletetitle() {
>     $this->set('results', $this->Publication->find('all', array(
>             'conditions' => array(
>                 'Publication.itemName LIKE' => $this->data['q'].'%'
>                 ),
>             'fields' => array('itemName')
>                 )));
>     $this->layout = 'ajax';
> }
>


*And my form*

<?php echo $form->create('Publication', array('action' => 'sresults', 'type'
> => 'get'));?>
> <?php echo $ajax->autoComplete('q', '/publications/autocompletetitle'); ?>
> <?php echo $form->end('Search'); ?>
>

The autocompletetitle view is set and working, I can see it when accessing
/autocompletetitle and if I search.

--
Louie Miranda
 - Email: [email protected]
 - Web: http://www.louiemiranda.com

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" 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

Reply via email to