none
Promoted Links List - a confirmation dialog RRS feed

  • Question

  • Hi,

    I have a Promoted Links List on my home page. I need to ask users for confirmation if they want to navigate to a selected link. One method of doing that is to show a JavaScript confirm dialog with a question such as "Are you sure you want to proceed?".

    How could I add such a confirmation dialog to the items of my Promoted Links List?

    Thanks,

    Leszek


    Wiki: wbswiki.com
    Website: www.wisenheimerbrainstorm.com

    Tuesday, April 11, 2017 3:16 PM

Answers

  • Hi,

    Try to add script editor to the page and then bind click event to the prompt link.

    Here is my sample code for your reference.

     

    <script type="text/javascript" src="https://code.jquery.com/jquery-1.7.1.min.js"></script>
        <script type="text/javascript">
            ExecuteOrDelayUntilScriptLoaded(Customize, "sp.core.js");
            function Customize() {
                $('div.ms-tileview-tile-content').each(function () {
                    $(this).click(function () {
                        if (confirm("Are you sure you want to proceed?")) {
                            return true;
                        }
                        else {
                            return false;
                        }
                    });
                })
            }
        </script>

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Marked as answer by ata6502 Wednesday, April 12, 2017 3:59 PM
    Wednesday, April 12, 2017 1:57 AM

All replies

  • Hi,

    Try to add script editor to the page and then bind click event to the prompt link.

    Here is my sample code for your reference.

     

    <script type="text/javascript" src="https://code.jquery.com/jquery-1.7.1.min.js"></script>
        <script type="text/javascript">
            ExecuteOrDelayUntilScriptLoaded(Customize, "sp.core.js");
            function Customize() {
                $('div.ms-tileview-tile-content').each(function () {
                    $(this).click(function () {
                        if (confirm("Are you sure you want to proceed?")) {
                            return true;
                        }
                        else {
                            return false;
                        }
                    });
                })
            }
        </script>

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Marked as answer by ata6502 Wednesday, April 12, 2017 3:59 PM
    Wednesday, April 12, 2017 1:57 AM
  • Please check the article 

    http://www.ashokraja.me/articles/How-to-Show-and-Hide-a-Modal-Pop-up-Dialog-in-a-SharePoint-2013-Page-or-a-Visual-WebPart


    Thanks, Amit Kumar, LinkedIn Profile ** My Blog
    Please click "Mark As Answer" if this post solves your problem or "Vote As Helpful" if it was useful

    Wednesday, April 12, 2017 12:05 PM
  • Thanks Lee, this answers my question.

    Wiki: wbswiki.com
    Website: www.wisenheimerbrainstorm.com

    Wednesday, April 12, 2017 3:59 PM
  • Hi Amit,

    The article you pointed out seems to be irrelevant to the question. It does not mention the Promoted Links List or maybe I'm reading it incorrectly.

    Thanks anyway,

    Leszek


    Wiki: wbswiki.com
    Website: www.wisenheimerbrainstorm.com

    Wednesday, April 12, 2017 4:01 PM