Hi all,
Im brand new to Cake and to PHP in general. Im trying to setup a
simple Ajax Autocomplete script going.. I have a DB table called Posts
with a bunch of names called Title.
I just want to have a simple textbox that autocompletes and fills in
the selected title...
Im using CAKE PHP v 1.2 . My probem is that the textbox renders
correctly but the AJAX part is not working.... What am I missing ? Pls
help
Here is a snippet from my controller (posts_controller.php)
function autoComplete()
{
echo 'in the loop';
//$this->set('posts',$this->Post->findAll("title LIKE '{$this-
>data['Post']['title']}'"));
$this->set('posts', $this->Post->findAll());
$this->layout = 'ajax';
}
Here is a snippet from my view (view.thtml)
<form action="myapps/blog/posts/autoComplete" method="POST">
<?php echo $ajax->autoComplete('Post/title' ,'/myapps/blog/posts/
autoComplete');?>
</form>
Here is a snippet from my view (auto_complete.thml)
<ul>
<?php foreach($posts as $post): ?>
<li>
<?php echo $post['Post']['title']; ?>
</li>
<?php endforeach; ?>
</ul>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---