A lot of my Sharepoint Sites require input from the Users to add to Lists, Document Libraries and so on. However, sometimes Users have trouble finding the "Add New Item" button when attempting to add to a list.

I've gotten around the issue by simply adding a more visible button to the page (via HTML) which links directly to the NewForm.aspx page for my List. This gets the job done, but I'd rather have the NewForm appear as a Pop-Up window like it would when clicking the actual "Add New Item" button.

Is there a way to implement the Add new item Pop-Up form into my HTML code? Perhaps with Javascript perhaps?

1 Answer 1


Yes you can call the SP JavaScript library to open up the modal pop up.

$('.button').click(function (e) {
        var options = SP.UI.$create_DialogOptions();
        options.url = $(this).attr("href"); //url of the newitem.aspx
        options.dialogReturnValueCallback = Function.createDelegate(null, processClose);

    function processClose(result, returnValue) {
        if (result == SP.UI.DialogResult.OK) {
            if (returnValue == null) {
                SP.UI.Notify.addNotification('Operation successful');

This code above will open the modal dialog and handle closing of it. Also i am using jquery, so make sure you have that referenced in the page.


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.