How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask TheDoctor Your Own Question
TheDoctor, Software Engineer
Category: Programming
Satisfied Customers: 1757
Experience:  M.S. in Internet Information Systems
Type Your Programming Question Here...
TheDoctor is online now
A new question is answered every 9 seconds

For "The Doctor" Only Hello Doctor, Sorry to bother you

This answer was rated:

For "The Doctor" Only

Hello Doctor,

Sorry to bother you again on this, but SharePoint is such a monster!

The script you used is completely awesome and I love the fact you used default SharePoint dialogs. I like that way better than the previous java script.

I have tried to use the script on various other pages and it is not working...LOL... go figure. I am sure it is something you can figure out, and I am sure it is a SharePoint issue causing it.

Basically I took your script and copied it to another page :

but no dialog pops up. The difference with this page is it is a publishing page and not a web part page as we were working on earlier.

I have been able to get links to open in Dialogs following some examples, however the trick I am looking to do is this:

1. Pass a URL into the spdialog function no matter where the url comes from on the page.

there are a couple of ways that a sharepoint url can be created on the page:

1. sumXXXXX XXXXXnk web part (which is what I am using ALOT)
2. Content Editor web part
3. Main content area within the page

An example that works on any page currently is:

Upload a Document

Howver, I would like to pass a variable as the URL, and in order to allow me specific URLS something like RootFolder= is a good search.

However , I am open to any suggestion.. What ever is easier , even if I had to Hard code the URL in the script that's completely cool.

Something that could work would be:

1. url 1
2. url 2
3 url3

then your jquery could say IF url = 1 or 2 or 3 then open in dialog

but if searching for like: RootFolder= or another key term I could replace is cool too. Whatever you think is easier and could work on all pages and URLs

Anyway, hould you check the HR site

edit page
code is on left hand side under the menu "edit snippet"

Hello again! Thank you for requesting me.

I don't see the edit page option on that page. Do I not have permissions or am I not looking in the right place?
Customer: replied 3 years ago.

It is the gear icon at the top right of the page. I just gave you full control on the site

Customer: replied 3 years ago.

ooops hold on I forgot to add the code in...Sorry adding now...Its a web part I need to add in. I was playing with it and forgot to add back in

The gear icon on the top right of the page has:

Shared with...
Add a page
Add an app
Site contents
Device manager
Site settings
Office 365 settings

There is no edit option
Customer: replied 3 years ago.

Ok , just added permissions....


I needed to add you to the library that holds the Pages...


You may need to refresh

Customer: replied 3 years ago.

I also just gave you master control of all sites....You should have all permissions now

Which links do you want to open in a new dialog on that page?
Customer: replied 3 years ago.

New Hire Request

Contractor Action Request

Employee Business card Request


they all have rootfolder= as a common url




Customer: replied 3 years ago.
I have encountered a new issue. I'm working through it.
Hello again Larry!

I believe that I got it working correctly.

The issue that I ran into this time is that I could not reference SP.UI.ModalDialog directly. I had to use SP.SOD.executeFunc, as the modal dialog script is registered with the RegisterSOD function.

The code that is on this page now is the one that should be used by default for wherever in the site you use this RootFolder approach. The code on the other page is specific to that page, as I didn't know you would need it on multiple pages.

Let me know if you need anything else or if anything isn't working quite right.

Please remember to rate my answer. Thank you so much!
TheDoctor and 2 other Programming Specialists are ready to help you
Customer: replied 3 years ago.

Excellent!!! Thank you! It works great!!!



You are very welcome! Have a great day!

Related Programming Questions