0

I am trying to use a modal on my application and something weird is going on. When I press the button to open the modal, it pops up and disappears right away. I can see the modal content for a second before it closes. Here is my code for the basic modal:

   <button class="btn btn-primary" type="button" data-toggle="modal" data-target="#myModal">Upload Images</button> <div class="spacer"></div>
  <textarea class="autosize-transition form-control" placeholder="Please enter information." id="form-field-11" style="overflow: hidden; word-wrap: break-word; resize: horizontal; height: 200px; width: 720px"></textarea>

  <!-- Modal -->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title">Modal title</h4>
          </div>
          <div class="modal-body">
            This is where you insert the content you want to display in the modal.
          </div>
          <div class="modal-footer">
            <!-- footer area with buttons for a continued dialog -->
            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            <button type="button" class="btn btn-primary">Save changes</button>
          </div>
        </div><!-- /.modal-content -->
      </div><!-- /.modal-dialog -->
    </div><!-- /.modal --> 

am I using a class that makes this happen? I have no idea why this behaves the way it does and I hope my question is clear enough for you pro's to dissect it and help me out. Thanks to anyone in advance who knows why my modal closes right when I open it.

Knut Holm
  • 3,988
  • 4
  • 32
  • 54
ZachyBear
  • 297
  • 3
  • 15
  • 1
    You need to add some info about the javascript which is managing the modal. – Max Williams Sep 19 '14 at 16:35
  • I am using the ACE template which includes bootstrap and a ton of minified js/jquery files I will try and find the JS that is supposed to be manipulating this modal. – ZachyBear Sep 19 '14 at 16:44
  • @ZachyBear did you write any js which is conflicting with bootstraps js? – Mandeep Sep 19 '14 at 16:51
  • no, I just through in this basic modal – ZachyBear Sep 19 '14 at 16:52
  • @ZachyBear `it pops up and disappears right away` suggests to me that some js is closing it. Try opening it manually – Mandeep Sep 19 '14 at 16:56
  • Seems similar to the question asked/answered here: http://stackoverflow.com/questions/13648979/bootstrap-modal-immediately-disappearing – brntsllvn May 10 '15 at 21:55
  • Possible duplicate of [Bootstrap Modal immediately disappearing](https://stackoverflow.com/questions/13648979/bootstrap-modal-immediately-disappearing) – merv Dec 29 '17 at 18:07

0 Answers0