When working with a Modal Popup window that appends rows to an HTML table after a successful AJAX post, I am encountering an issue. While the appending functionality works properly, I am struggling to incorporate a field value from the modal as a variable in the JavaScript .append statement. The following code represents the current success method for the AJAX call, which performs correctly aside from extracting the NoteText value:
success: function (result) {
var noteText = $("#NoteText").val();
$("#TenantNotesTable").append('<tr><td class="EditButton">@Html.ActionLink("Note Details", "AddTenantNote", New With {.id = 0}, New With {.id = "openDialog", .class = "ButtonControl"})</td><td class="NoteDate">@DateTime.Now.ToShortDateString</td><td class="noteText">NoteText SHOULD SHOW HERE</td><td class="EnterBy">@Model.NoteEnteredBy</td>');
$('#waitMessage').hide();
$("#dialog-edit").dialog().dialog('close');
},
I am currently learning JavaScript as I encounter new challenges, and would appreciate your understanding.