how to prevent my bootstrap modal from closing with the keyboard and only with the bonton accept from the same modal? [duplicate]

0

Hi, I have created a boostrap modal and I have removed the ×

and of course it does not have a cancel button, only one accept that it directs me to another page. Well, what I need is that my modal is not closed with the ESC key or clicking on another part of the screen (since it also closes), only and only that it stays there and does not close, once the user does click on open modal, I can not remove it. Is there any way? Thank you Greetings

I'm working on an asp .net webform application with c #

    
asked by sunflower 06.03.2018 в 17:19
source

1 answer

0

Passing options to the modal by means of jQuery $('#myModal').modal(options) options is an object of options and has an attribute backdrop which can be specified to be static, that is, the window does not close when you click on out of this:

$('#myModal').modal({
      backdrop: 'static'
  });

For more information I could see the boostrap documentation: Boostrap modal options

    
answered by 06.03.2018 / 17:52
source