0

I have create two Html and linked to content editor in SharePoint page.

First HTML Page

<link href="https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
function openDialog(pageUrl) {
    var options = {
        url: pageUrl,
        title: 'CAD',
        allowMaximize: false,
        showClose: true,
        width: 300,
        height: 300
    };
    SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
}
</script>
<a href="#" onclick="openDialog('../sites/EnggTools/SiteAssets/Dropdown.html');">
<img class="test" src="../sites/EnggTools/PublishingImages/Solidworks/SolidworksDassaultSystem.jpg" alt="" />
</a>

Second HTML Page

<script type="text/javascript">
function navigate(value)
{
    var loc = value.value;
    window.location.href = loc;        
}
</script>
<div id="dialog-modal">
  <select id="links" onchange="navigate(this)">
      <option>-select-</option>
      <option value="http://my.flowserve.com/person.aspx">Flowserve</option>
      <option value="https://www.gmail.com">Gmail</option>
  </select>
</div>

In first page code, am displaying Image hyperlink and in <script> tries to open modal dialog box.

In second page code, am displaying drop down using <select> inside modal dialog box.

The result am getting when am clicking image it shows popup but the result shows inside modal dialog. As show in below image:

enter image description here

  • From your code, it seems that you are trying to open dialog box by image click and that's what happening but you are unable to see the page on the dialog box, is that correct? – Pradip R. May 2 '18 at 9:45
  • Yes, but I need the result in current page not in modal dialog box. As shown in image, the result Sorry, you can't use this email service. is showing in dialog box but I need in current page. – san May 3 '18 at 3:05

Your Answer

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

Browse other questions tagged or ask your own question.