Here is one method
Check out this piece of code from this link
http://www.grahambird.co.uk/cake/tutorials/ajax.php
It will help you, if this confuses you, please paste enough of your
code here that can be understood, and will make suggestions based on
that.
<?php
foreach ($data as $row)
{
$item = $row['Task'];
if ($item['done'] == 1)
{
print '<div class="task" id="done_' . $item['id'] . '">';
print '<input id="done_check_' . $item['id'] . '"
type="checkbox"
checked="true" onClick="new Ajax.Updater(\'tasks_todo\',\'/tasks/
undo/' . $item['id']. '\', {asynchronous:true, evalScripts:true});new
Effect.Fade(\'done_' . $item['id'] . '\');" /> ';
print '<label for="done_check_' . $item['id'] . '">' .
$item['title'] . '</label>';
print $ajax->link('Delete', 'delete/' . $item['id'],
array('update'=>'tasks_done'));
print '</div>';
}
}
?>
On Mar 8, 4:05 pm, paulsc <[EMAIL PROTECTED]> wrote:
> i need help but can't find any actual examples. I'm looking for a simple
> stupid example.
> I have a html table and each row has a link. I want to be able to click that
> link and have it use ajax to update a div with an element. I would like to
> give this element data, say an object id, or an array of of the objects
> attributes for the particular row of the table that was clicked. How can I
> do this? Thanks.
>
> --
> View this message in
> context:http://www.nabble.com/using-%24ajax-%3Elink-to-update-a-div-tp1592050...
> Sent from the CakePHP mailing list archive at Nabble.com.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---