we are implementing a feature in sharepoint where the user can share documents, we are reworking our own UI to make it easier for the end user. We have a modal popup where you can select multiple users, once you click okay, they will receive a email and the permissions to edit the shared document.

In the user selection, we want to use a Modal, i know sharepoint already has a Modal where you can select multiple users, i was wondering if there where any ways we could use that one and change the OnOkButtonClick event to redirect to our custom functions to give the users permissions etc...

Thanks :D

1 Answer 1


There is this SP.UI.ModalDialog class (MSDN doku). With dialogOptions you can specify, how will your page behave after the user closes the dialog.

function OpenMasterdataDialog(strPageURL) {
    var dialogOptions = SP.UI.$create_DialogOptions();
    dialogOptions.url = yourPageWithDialogContent;
    dialogOptions.width = 750;
    dialogOptions.height = 950;
    dialogOptions.dialogReturnValueCallback = closedCallback; // Function to capture dialog closed event
    return false;

function closedCallback(dialogResult) {
   //your method to redirect to new page
  • This would be a new modal, am looking for ways to use already existing modals with all the controls already set and then just change the Callback on the OK button. An exemple of this would be when you go to site settings > site permissions > grant permission, the modal popup as what i need, cant i just use that one ? Commented Apr 12, 2012 at 15:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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