Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add custom confirm message to standard joomla 3.0 admin toolbar button

Add custom confirm message to standard joomla 3.0 admin toolbar button.

I can get alert messages on delete when I don't selected any check boxes on detailed list.

I can get same on any button by set last parameter true in

JToolBarHelper::custom('userdetails.sendMail', 'mail.png', 'mail_f2.png', 'Send Mail', false);

I want to add a confirm message on the click event of this Button?

like image 978
Chintan Thummar Avatar asked Aug 11 '14 12:08

Chintan Thummar


1 Answers

On view file (tpl/view file name).

<script type="text/javascript">
    Joomla.submitbutton = function(task)
    {
        if (task == 'userdetails.sendMail')
        {
            if (confirm(Joomla.JText._('Do you really want to send mails to selected users?'))) {
                Joomla.submitform(task);
            } else {
                return false;
            }
        }
    }
</script>
like image 157
Suman Singh Avatar answered Sep 20 '22 20:09

Suman Singh