Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
550 views
in Plugins by

I did download the confirm dialog plugin and enabled and saved it at the admin section but it is not working. Uninstalled and installed it again but still no luck. There are no warnings or anything, just no effect. Any tips what to do or how to locate the problem? Thank You

Q2A version: 1.5

1 Answer

0 votes
by
Do you know what to expect?  The warnings will only show up if you have entered data into a textbox and then try to navigate away from the page.  If that's not working, check the page source to see if the javascript functions are loading into the head section.  This should be somewhere in the head:

<script type="text/javascript">
jQuery("document").ready(function() {

    jQuery("form").submit(function(event) {
        window.onbeforeunload = null;
    });

    window.onbeforeunload = function(event) {
        var content = false
        jQuery("textarea:visible").each( function() {
            if(this.value) {
                content = true;
                return false;
            }
        });
        if (content)
            return "You have entered text; are you sure you wish to leave this page?";

    }
});
</script>
by
I did check the source and yes I can see the code you posted there.  I did enter some text to text editor and try to navigate away but there was no warning.
by
if you send me a link, I can take a look.
by
Right, it doesn't work for wysiwyg, because it's in an iframe.  Better to switch to markdown editor.
by
Ok, yes I tried that with comments, where I am using basic editor and it worked alright. Thank you for solving this for me.
...