0

I want to make a modal where in if I click the button the modal pops up and the content of the modal is from a different page. Please help me.

This is my code

  <a href="#" class="btn btn-lg btn-success" data-toggle="modal" data-target="#basicModal">Click to open Modal</a>
    <div class="modal fade" id="basicModal" tabindex="-1" role="dialog" aria-labelledby="basicModal" 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" id="myModalLabel">Basic Modal</h4>
          </div>
          <div class="modal-body">
            <h3>Modal Body</h3>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            <button type="button" class="btn btn-primary">Save changes</button>
          </div>
        </div>
      </div>
    </div>

I want to know what Javascript? and where exactly should I put it? I'm using bootstrap v 3.03 by the way.

Hakan Fıstık
  • 16,800
  • 14
  • 110
  • 131
itskcl
  • 23
  • 1
  • 9
  • I think this: http://stackoverflow.com/questions/23801446/bootstrap-modal-from-another-page will answer your question. – adyopo Sep 22 '14 at 06:45
  • Hi. it's not working. :( I need a button that if I click it a modal will pop out but the content is from a different page. It's a form. – itskcl Sep 22 '14 at 06:50

1 Answers1

1

I think this is what you're looking for.
You need to pay special attention to this line in particular:

<a data-toggle="modal" class="btn btn-info" href="remote.html" data-target="#myModal">Click me !</a>
Hakan Fıstık
  • 16,800
  • 14
  • 110
  • 131
adyopo
  • 46
  • 1
  • 4