I am using the SP.UI.ModalDialog to popup a custom form. The form uses an XSL stylesheet that uses the GenFireServerEvent to commit the data. This works correctly, but I want to close the popup once the data is saved. What do I need to do to modify this form to commit the data and close the dialog?


I am adding this so that others who stumble accross it might find it useful. I got this to work by adding a __redirect to the GenFireServerEvent like this: onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={WhateverPage.aspx?IsDlg=5'})"

Then on this page add something like this:


function closeme() {
    if (tp1.indexOf("IsDlg=5") > 0) { window.frameElement.commitPopup(); }

This is what I needed to make this work!

  • above solution not working for me. can you please suggest me other solution – Rahul Dayal May 2 '16 at 15:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.