How to give confirmation for deletion through link? I have tabular format data and each row I have an edit and delete links , on clicking on the delete link it should ask for a confirmation to delete and if press delete only I need to delete. Now its asking for confirmation but not deleting any. Instead its giving me a blank page. Is it because it's submitted to the same function? It's not going to the products_delete_confirm_submit() on submission by the way. Or is there any workaround for this?

Here is the try :

Menu call back: 

 function mailusers_menu() {
     $items['mailusers/usergroup/delete'] = array(
        'title' =&gt; 'Delete User group',
        'page callback' =&gt; 'drupal_get_form',
        'page arguments' =&gt; array('products_delete_confirm', 3),
        'type' =&gt; MENU_CALLBACK,
        'access callback' =&gt; TRUE,
        'access arguments' =&gt; array('access admin tab'),
      );
 return $items;
}


callback function 

function products_delete_confirm($form,$product_code) {
$form['_product'] = array(
        '#type' =&gt; 'value',
        '#value' =&gt; $product_code,);
//$form['#action'] = url("mailusers/products_delete_confirm_submit");
//      //drupal_set_message($product_code);

return confirm_form($form,t('Are you sure you want to delete '.$product_code.' Product?'),
        isset($_GET['destination']) ? $_GET['destination'] : "mailusers",t('This action cannot be undone.'),t('Delete'),t('Cancel'));

}


Delete submit handler:

function products_delete_confirm_submit($form, &amp;$form_state) { 
  $form_values = $form_state['values'];
  if ($form_state['values']['confirm']) {
  $param = $form_state['values']['_product'];
    drupal_set_message(t('Product ' .$param.' will get deleted.'));                             
    db_query('DELETE FROM {content_type_usergroup} WHERE vid = %d', $param);
    drupal_set_message(t('usergroup has been deleted.'));          
    drupal_goto('mailusers');
 }
}


And in the table I am calling the delete link href="mailusers/usergroup/delete/10"
Don't bother testing the value of confirm, the user is only given a choice to submit or go back (with cancel link).

function products_delete_confirm_submit($form, &amp;$form_state) { 
  $param = $form_state['values']['_product'];
  drupal_set_message(t('Product ' .$param.' will get deleted.'));                             
  db_query('DELETE FROM {content_type_usergroup} WHERE vid = %d', $param);
  drupal_set_message(t('usergroup has been deleted.'));          
  $form_state['redirect'] = 'mailusers';
}


Also, your access callback is set to TRUE, which bypass all permission checking.

Final answer

It should be products_delete_confirm(&amp;$form_state, $product_code), see the example at https://www.drupal.org/node/751826#creating, you were messing with your form structure.