0

Given below is the code for submit button click in ctrl.js of my angular.js application

namespace.btnClick = function {
     $('#btnID').confirmation({
           'onConfirm' : function () {
            return true;
     },'placement':right,'title' : "Alert"
});
$('#btnID').confirmation('show');

btnID is the id of the submit button. After clicking submit button for first time, it showing bootstrap Confirmation box with Yes and No button. If I click Yes button then its calling onConfirm method, after that again its calling this submit button click function for first time. If I click submit button for second time, its calling this submit button click function but it doesn't show confirmation box.

4
  • Is it possible to have a plunker example ? Commented Sep 30, 2014 at 10:19
  • no. Is there possible to find out that where I made mistake in above piece f code? please Commented Sep 30, 2014 at 10:24
  • It would be easier to fix your issue using a plunker. We can only guess what's wrong, we can't really figure it out. If you can't setup a plunker because of some sensitive code, you should just setup a simple "Hello World" application implementing this exact scenario. Commented Sep 30, 2014 at 11:33
  • Hello Lght, okay. I will do in future. thanks for your reply Commented Sep 30, 2014 at 11:34

2 Answers 2

1

I used below code and its working fine

bootbox.confirm("Are you sure?", function(result) {
  Example.show("Confirm result: "+result);
}); 

Kindly refer this: http://bootboxjs.com/

Sign up to request clarification or add additional context in comments.

Comments

0

You probably needs angular-UI bootstrap library and use it as

var modalInstance = $modal.open({
      templateUrl: 'myModalContent.html',
      controller: 'ModalInstanceCtrl',
      size: size,
      resolve: {
        items: function () {
          return $scope.items;
        }
      }
    });

Please find the library here.

1 Comment

Hello Mahesh Thumar, thanks for your reply.sorry I can't implement this. This is modal popup that I already implemented in my application. but for this scenario, I want bootstrap confirmation box that I mentioned above. kindly tell where I made mistake

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.