начни с того момент когда ты открываешь модалку
$("#submitBtn").on('click', () => {
let updateData = {
note: $("#note").val(),
clientId: @Model.ClientId,
};
$.ajax({
url: '@Url.Action("Create", "Note")',
method: 'post',
data: JSON.stringify(updateData),
dataType: 'json',
contentType: 'application/json; charset=utf-8;',
success: (response) => {
let clientNote = response.note;
let appendNotemakrup = '<div id="client-personal-note-' + clientNote.id + '" class="card card-body alert-success">' +
'<i class="text-break" id="note-' + clientNote.id + '">' + clientNote.note + '</i>' +
'<b>@localizator["JustCreated"]</b>' +
'<br />';
document.getElementById('client-personal-note-container').innerHTML += appendNotemakrup;
$('#note').val('');
location.href = '#client-personal-note-' + clientNote.id;
setTimeout(() => {
$('#client-personal-note-' + clientNote.id).removeClass('alert-success');
}, 3000);
},
error: (response) => {
let jsonResponse = JSON.parse(response.responseText);
if (jsonResponse.hasOwnProperty("Note")) {
document.getElementById('note-error-label').innerHTML = jsonResponse.Note;
}
if (jsonResponse.hasOwnProperty("errorMessage")) {
document.getElementById('note-error-label').innerHTML = jsonResponse.errorMessage;
}
},
});
});
document.querySelectorAll('.links-text')
.forEach(el => el.innerText = el.innerHtml.replaceAll(' ', ' '));