I found a couple great functions that allow me to programmatically call up a modal edit form, and they work very well. What I'm looking for is a way to update a div on the calling page with the contents of the modal form's UserNote field once I click the Submit button.
function displayProgInfo(progId) {
var options = SP.UI.$create_DialogOptions();
options.resizable = 1;
options.scroll = 1;
options.title = "Update Program Information";
options.url = "/address/_layouts/listform.aspx?PageType=6&ListId={[ListID]}&ID=" + progId;
options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback);
SP.UI.ModalDialog.showModalDialog(options);
}
function CloseCallback(result, target) {
if (result != 0) {
window.parent.location.href = window.location.href;
// Replace the note after clicking save in the modal dialog
htmlBuilder = "<div id='noteField'>" + [contents of UserNote field] + "</div>";
$("#noteField").replaceWith(htmlBuilder);
}
}
The hangup right now is how to capture and save the contents of the UserNote field before the form closes. The articles and questions I've found so far don't offer me much that I understand; can anyone provide an answer that helps in this situation?