Hi,
I am having some trouble getting a confirmation popup working on a custom task. Any help appreciated.
It is in the Item View. When a user clicks "Submit" I would like a message to pop up to say "Are you sure you wish to Submit...?" - just like the Delete task works.
In my fork/views/_item/view.html.php file I have added this javascript....
<script type="text/javascript">
Joomla.submitform = function(task)
{
if (task == 'device_item.submitdevice')
{
if (confirm(Joomla.JText._('Are you ready to Submit this device? It will then become locked.'))) {
Joomla.submitform(task);
} else {
return false;
}
}
}
</script>
This is the line that creates the toolbar button...
// Submit
JToolBarHelper::custom('device_item.submitdevice', 'cog', 'cog', "TEST_JTOOLBAR_SUBMIT", false);
. Thanks for any help - this has been driving me nuts all day