Home:ALL Converter>Bootstrap modal window instead of jQuery modal window

Bootstrap modal window instead of jQuery modal window

Ask Time:2015-05-04T21:21:42         Author:Alexander

Json Formatter

I'm new in web. I wrote this jQuery modal window:

<div id="dialog" title="Basic dialog" class="modal-body" style="display:none;">
  <p>@Html.TextArea("commentForDecline")</p>
  <button title="Ok" class="btn btn-primary ok-request">Ok</button>
</div>

And this is my JavaScript code:

function declineButtonClick(th) {    
  tempId = $(th).attr('data-id');
  $('#dialog').attr('data-id', tempId);
  $("#dialog").dialog();
}

$('button.ok-request').click(function () {
  var tempId = $('#dialog').attr('data-id');
  var message = $('textarea#commentForDecline').val();
  $.ajax({
    type: "POST",
    url: "/TableRequest/DeclineRequest",
    data: { 'message': message, 'id': tempId },
      success: function (msg) {
    }
  });
  $("#dialog").dialog('close');
  $('button[data-id="' + tempId + '"]')
    .parent()
    .parent()
    .find('div.True')
    .attr('class', "False");

  $('button[data-id="' + tempId + '"]')
    .parent()
    .parent()
    .find('img.decline-img')
    .show();

  $('button[data-id="' + tempId + '"]')
    .parent()
    .parent()
    .find('img.accept-img')
    .hide();

  $('button[data-id="' + tempId + '"]')
    .parent()
    .find('button.decline-button')
    .hide();

  $('button[data-id="' + tempId + '"]')
    .parent()
    .find('button.accept-button')
    .show();

  $('textarea#commentForDecline').val('');
});

I need to put bootstrap classic modal window instead of my jQuery modal window. So I added bootstrap class, but nothing changed. I know that it should be simple but can't do it. Can anyone help me? I will be very grateful.

Author:Alexander,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/30031262/bootstrap-modal-window-instead-of-jquery-modal-window
yy