2

How we can add confirm dialog before publishing or unpublish article in Joomla ? I want to add confirmation box before publish or unpublish, I want same for custom component also, how i can achive this? Please guide

2

You can do this by adding the following code to the very end of your /administrator/components/com_content/views/tmpl/edit.php:

<script>
    jQuery("#jform_state").on('change', function(e){
        if (confirm("Are you sure you want to change the status of this article?") != true) {
            e.preventDefault();
        }
    });
</script>

A better idea is to copy the edit.php file to the corresponding location of your admin template and then make the modification there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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