I struggled with this for while as I don't like relying on java being switched 
on. Here's an article I put together that borrows heavily from other 
contributors here. It might help. 
http://www.jeremy-burns.co.uk/2009/12/cakephp-adding-a-delete-confirm-function/

Jeremy Burns
jeremybu...@me.com


On 11 Feb 2010, at 15:55, sebb86 wrote:

> Hello all,
> 
> thanks for all your answers. After reading all your answers, i've
> decided to use a image, which links to a page.
> Could someone help me to add a warning-message, e.g. when i delete
> something???
> 
> Here is my image/link code from the view:
> [code]
>        <?php echo $html->image("delete.png", array("alt" => "delete",
> 'url' => array('controller' => 'hardware_units', 'action' => 'delete',
> 'id' => $hardware_unit['HardwareUnit']['id'])));?>
> [\code]
> 
> And my delete function in the controller:
> [code]
> function delete($id)
>       {
>               $this->HardwareUnit->del($id);
>               $this->Session->setFlash('hardware unit with id: '.$id.' has 
> been
> deleted');
>               $this->redirect(array ('action' => 'index'));
>       }
> [\code]
> 
> 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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to