Bootstrap Modal not popping alert when clicked









up vote
1
down vote

favorite












Bootstrap Modal button save is not working when clicked.Below is my jquery:



$('#add-more-academic').on('click',function()
$('#myModal').modal();
)
//==================================================
$('.SaveAcademic').on('click',function(){
var academic = $('#new-academic').val();
alert(academic);


Upon clicking Save on my modal an alert dialog should display showing what I have entered in my text box. Below is my modal:



<!-- Modal -->
<div id="myModal" tabindex="-1" aria-hidden="true" class="modal fade" role="dialog">
<div class="modal-dialog">

<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Academic Year</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-12">
<input type="text" name="academic_year" id="new-academic" class="form-control" placeholder="Academic Year">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-success SaveAcademic" id="SaveAcademic">Save</button>
</div>
</div>

</div>
</div>
</html>











share|improve this question

























    up vote
    1
    down vote

    favorite












    Bootstrap Modal button save is not working when clicked.Below is my jquery:



    $('#add-more-academic').on('click',function()
    $('#myModal').modal();
    )
    //==================================================
    $('.SaveAcademic').on('click',function(){
    var academic = $('#new-academic').val();
    alert(academic);


    Upon clicking Save on my modal an alert dialog should display showing what I have entered in my text box. Below is my modal:



    <!-- Modal -->
    <div id="myModal" tabindex="-1" aria-hidden="true" class="modal fade" role="dialog">
    <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
    <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal">&times;</button>
    <h4 class="modal-title">Academic Year</h4>
    </div>
    <div class="modal-body">
    <div class="row">
    <div class="col-sm-12">
    <input type="text" name="academic_year" id="new-academic" class="form-control" placeholder="Academic Year">
    </div>
    </div>
    </div>
    <div class="modal-footer">
    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
    <button type="button" class="btn btn-success SaveAcademic" id="SaveAcademic">Save</button>
    </div>
    </div>

    </div>
    </div>
    </html>











    share|improve this question























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      Bootstrap Modal button save is not working when clicked.Below is my jquery:



      $('#add-more-academic').on('click',function()
      $('#myModal').modal();
      )
      //==================================================
      $('.SaveAcademic').on('click',function(){
      var academic = $('#new-academic').val();
      alert(academic);


      Upon clicking Save on my modal an alert dialog should display showing what I have entered in my text box. Below is my modal:



      <!-- Modal -->
      <div id="myModal" tabindex="-1" aria-hidden="true" class="modal fade" role="dialog">
      <div class="modal-dialog">

      <!-- Modal content-->
      <div class="modal-content">
      <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal">&times;</button>
      <h4 class="modal-title">Academic Year</h4>
      </div>
      <div class="modal-body">
      <div class="row">
      <div class="col-sm-12">
      <input type="text" name="academic_year" id="new-academic" class="form-control" placeholder="Academic Year">
      </div>
      </div>
      </div>
      <div class="modal-footer">
      <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      <button type="button" class="btn btn-success SaveAcademic" id="SaveAcademic">Save</button>
      </div>
      </div>

      </div>
      </div>
      </html>











      share|improve this question













      Bootstrap Modal button save is not working when clicked.Below is my jquery:



      $('#add-more-academic').on('click',function()
      $('#myModal').modal();
      )
      //==================================================
      $('.SaveAcademic').on('click',function(){
      var academic = $('#new-academic').val();
      alert(academic);


      Upon clicking Save on my modal an alert dialog should display showing what I have entered in my text box. Below is my modal:



      <!-- Modal -->
      <div id="myModal" tabindex="-1" aria-hidden="true" class="modal fade" role="dialog">
      <div class="modal-dialog">

      <!-- Modal content-->
      <div class="modal-content">
      <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal">&times;</button>
      <h4 class="modal-title">Academic Year</h4>
      </div>
      <div class="modal-body">
      <div class="row">
      <div class="col-sm-12">
      <input type="text" name="academic_year" id="new-academic" class="form-control" placeholder="Academic Year">
      </div>
      </div>
      </div>
      <div class="modal-footer">
      <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      <button type="button" class="btn btn-success SaveAcademic" id="SaveAcademic">Save</button>
      </div>
      </div>

      </div>
      </div>
      </html>








      javascript jquery html modal-dialog






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 11 at 0:51









      Collin Njuguna

      61




      61






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          Check this link for more info about bootstrap and alerts.






          share|improve this answer




















          • I think it will help you because it did help me when I had alert problems.
            – Marko Maksimovic
            Nov 11 at 1:11










          • Let me have a look at it
            – Collin Njuguna
            Nov 11 at 1:16










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53244874%2fbootstrap-modal-not-popping-alert-when-clicked%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote













          Check this link for more info about bootstrap and alerts.






          share|improve this answer




















          • I think it will help you because it did help me when I had alert problems.
            – Marko Maksimovic
            Nov 11 at 1:11










          • Let me have a look at it
            – Collin Njuguna
            Nov 11 at 1:16














          up vote
          0
          down vote













          Check this link for more info about bootstrap and alerts.






          share|improve this answer




















          • I think it will help you because it did help me when I had alert problems.
            – Marko Maksimovic
            Nov 11 at 1:11










          • Let me have a look at it
            – Collin Njuguna
            Nov 11 at 1:16












          up vote
          0
          down vote










          up vote
          0
          down vote









          Check this link for more info about bootstrap and alerts.






          share|improve this answer












          Check this link for more info about bootstrap and alerts.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 11 at 1:11









          Marko Maksimovic

          46




          46











          • I think it will help you because it did help me when I had alert problems.
            – Marko Maksimovic
            Nov 11 at 1:11










          • Let me have a look at it
            – Collin Njuguna
            Nov 11 at 1:16
















          • I think it will help you because it did help me when I had alert problems.
            – Marko Maksimovic
            Nov 11 at 1:11










          • Let me have a look at it
            – Collin Njuguna
            Nov 11 at 1:16















          I think it will help you because it did help me when I had alert problems.
          – Marko Maksimovic
          Nov 11 at 1:11




          I think it will help you because it did help me when I had alert problems.
          – Marko Maksimovic
          Nov 11 at 1:11












          Let me have a look at it
          – Collin Njuguna
          Nov 11 at 1:16




          Let me have a look at it
          – Collin Njuguna
          Nov 11 at 1:16

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53244874%2fbootstrap-modal-not-popping-alert-when-clicked%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          How to read a connectionString WITH PROVIDER in .NET Core?

          In R, how to develop a multiplot heatmap.2 figure showing key labels successfully

          Museum of Modern and Contemporary Art of Trento and Rovereto