0

How to get Bootstrap modal open after clicking okay to an JavaScript confirm?

My code:

 function generatexy(){
       var xyz = document.getElementById('solvednum').value;
      if(confirm('New SIR Number: '+ solvednum +' has been generated. Do you want to save?') == true){
      //After clicking okay on confirm - I want open bootstrap modal here.
         return true;
       }else{
         window.location = "<?php echo base_url(); ?>controller/method";
          return false;
       }
     }
James Z
  • 12,209
  • 10
  • 24
  • 44
M N
  • 69
  • 2
  • 14

1 Answers1

1

try this code, here #modal should be your modal id.

$('#modal').modal('show')
Bhaumik Pandhi
  • 2,655
  • 2
  • 21
  • 38