Question

I'm trying to use https://github.com/HubSpot/vex modal script for a confirm-dialog. If cancel is selected, the event of the href should cancel.

My a href:

<a href="goto.php" class="confirm" >confirm</a>

and my javascript:

$('a.confirm').click(function() {
                var page = $(this).attr('rel');
                vex.dialog.buttons.YES.text = 'Cancel';
                vex.dialog.buttons.NO.text = 'Go further';
                vex.dialog.confirm({
                        message: 'Are you sure to go?',
                        callback: function(value) {
                        if(value === false) {
                          //load the a href-site    
                        } else {
                          // cancel;
                          return false;
                        }
                        }
                    });
        });

Unfortunately the a href-site will just loaded after i click on the confirm-link. Do anybody can say me how a can change this event-handling?

thanks in advance.

best regards thomas

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top