Skip to main content
1 of 3
JA1
  • 117
  • 1
  • 6

SharePoint 2010 Modal box with multiple button redirects

I have a SharePoint modal box that is working fine with one button. However I need to change the design. I would like to have 3 buttons redirect to 3 different websites and the final one cancel.

In a CEWP I have SP.UI.ModalDialog.showModalDialog which creates the box and also have dialogReturnValueCallback: dialogCallback. Then I have at the bottom I have

function dialogCallback(dialogResult, returnValue) {
if(dialogResult== SP.UI.DialogResult.OK)
{
window.location.href = 'www.mywebsite.com/Site1'
}
}

Then in the HTML I have

<div>
<input type="submit" name="btn1" value="Site 1" onclick="closePage();" id="btn1" />
</div>

When I click on the button the modal closes and redirects me to the website defined in the function without error. how do I add more buttons and functions to the dialogCallback?

JA1
  • 117
  • 1
  • 6