Here is what i have: article_controller.php
/**
* Renders unorderd list for autocomplete tags
*
*/
function autocompleteTags ()
{
// Set tags var
$this->set('tags',
// Get all tags which start whith same characters
$this->Tag->findAll("tag LIKE '{$this->data['Tag']['tag']}%'
LIMIT
30"));
// Use ajax layout
$this->layout = "ajax";
}
autocomplete_tags.ctp
<ul>
<?php foreach($tags as $tag): ?>
<li id="<?php echo $tag['Tag']['id']; ?>"><?php echo $tag['Tag']
['tag']; ?></li>
<?php endforeach; ?>
</ul>
And in my add view i call the autocomplete:
<div id="TagTag_autoComplete" class="auto_complete"></div>
<script type="text/javascript">new
Ajax.Autocompleter('TagTag',
'TagTag_autoComplete',
'<?php echo
$this->webroot;?>/articles/autocompleteTags',
{afterUpdateElement:addExistingTags,
indicator:'spinner'});
</script>
<span id="spinner" style="display: none;">
<img src="<?php echo $this->webroot;
?>/img/spinner.gif"
alt="Working..." />
</span>
On Aug 14, 11:11 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> umm... anyone have a solution and want to share? i too am having
> problems with cakephp 1.2 with autocomplete
>
> On Jun 25, 12:11 am, "Jonathan Langevin" <[EMAIL PROTECTED]> wrote:
>
> > When I attempt it, I'm seeing autocomplete=off as well. What did you do to
> > fix this issue?
>
> > On 6/24/07, Mech7 <[EMAIL PROTECTED]> wrote:
>
> > > Ok i have it working i made a little error :D
>
> > > But how can i get it to work like the example on scriptaculous:
> > >http://demo.script.aculo.us/ajax/autocompleter
> > > Here you can use the arrow buttons to select a value which is not on
> > > default with the helper :(
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---