O
O
oe24y2014-03-05 12:29:16
JavaScript
oe24y, 2014-03-05 12:29:16

Bootstrap: Why doesn't the modal show up if the button* is inside some form?

* - refers to the button on which the modal window is shown.
Here is the code for the button (from the Bootstrap manual):

<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
  Launch demo modal
</button>


What I tried:
• Hang a click handler and write: Nothing is still happening • In the Chrome console, enter the line: In this case, the modal window appears. The jQuery used is 2.1.0
$('#myModal').modal('show');

$('#myModal').modal('show');

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri Morozov, 2014-03-05
@oe24y

If outside of the form works, then probably onsubmit intercepts sooner.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question