0

I create in administration list of some content and create link delete. On link delete I add attribute

onclick="return confirm('Are you sure?);"

but when you click "cancel" on confirm block drupal still go to link href:

http://www.supermarket.hr/#overlay=admin/categories/delete/6939/0

How can I anticipate some hidden overlay functions that ignore added confirm?

thx

3
  • you want the confirm for delete or cancel ? drupal usually asks anyway again if you try to delete content.
    – rémy
    Commented Feb 16, 2013 at 10:00
  • I create table list with that link and add to it onclick option, but when you click on link on the overlay it still open href.
    – kkatusic
    Commented Feb 16, 2013 at 14:14
  • can you show some src pls
    – rémy
    Commented Feb 16, 2013 at 19:12

1 Answer 1

0

Some code:

$option_delete = array(
        'attributes' => array(
            'onclick' => "return confirm('Delete order?');",
            'class' => "delete"
        )
    );

link:

l('delete', 'admin/orders/categories/'.$node->id.'/'.$page, $option_delete),

this link is showing up in list on administration overlay.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.