I have the following line of code which shows me the dialog of my list:

<a href="javascript:SP.UI.ModalDialog.ShowPopupDialog('http://mysite/Lists/mylist/NewForm.aspx');">Add New Item</a>

but instead of dialog I want to open a new window for NewForm of my list.

How can I make this via JavaScript?

1 Answer 1


Try to remove


to be like

<a href="http://mysite/Lists/mylist/NewForm.aspx" target="_blank">Add New Item</a>

Using target="_blank" : to Opens the linked document in a new window or tab


based on your request at comments ,

Use the following code and change the height and width

For more details, check the detail steps at Open a link via Modal Dialog in SharePoint

function openDialog(pageUrl) {
var options = {
url: pageUrl,
title: 'Title of the Dialog',
allowMaximize: false,
showClose: true,
width: 500,
height: 500
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
<a href="#" onclick="openDialog('http://SharePointSite/Lists/WebEvents/NewForm.aspx');">Central Admin</a>
  • yes but I need to be just like dialog with custom width and height
    – Iamnderon
    Aug 31, 2016 at 9:23
  • Please , Check my updated answer Aug 31, 2016 at 9:28

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.