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.