Support » Plugin: Modal Dialog » How to Trigger Modal Dialog via Button

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Yannick Lefebvre

    (@jackdewey)

    You just need to create a button that calls the modal_dialog_open javascript function in its onclick property.

    Does the Cookie Settings affect the Onclick Property?
    This what is happened…
    I click and close the modal dialog for 2 times then after that It loads so long then made a modal dialog for my entire page.

    What I have done wrong?

    Plugin Author Yannick Lefebvre

    (@jackdewey)

    No, the cookie is unrelated. I would need to see the problem in action to be able to understand what is happening. Is this on a live site? Can you put the dialog only on a page that is not linked from the others so I could see this problem live?

    What I did was I copy the entire Modal on the page and it works.
    You see I did Enable the Form on Single Display upon 14 days, thus if the person view the Modal on a Different Page not with that Trigger Button the Form disappear and when you click the Trigger Button it doesn’t Appear. That is why I did copy the form only to those pages with that Trigger Button.
    Is my observation correct?

    Plugin Author Yannick Lefebvre

    (@jackdewey)

    I don’t understand what you mean by ‘I copy the entire Modal on the page and it works’. And there is no ‘Enable the Form on Single Display’ option in Modal Dialog. Are you sure you are asking questions in the right plugin forum?

    Don’t worry about it. I did find a way to fix it.

    I needed a button that opened the modal also and I created a button that calls the modal_dialog_open javascript function on the home page. But the problem is that it only works if I select the “Display on front page” check box in settings, which also makes the modal pop up when the page first loads.
    And want it only when the button is clicked.

    Any ideas how to make it work right? If I don’t select that check box, the button doesn’t work onclick.

    Plugin Author Yannick Lefebvre

    (@jackdewey)

    You’re on the right track. Just set the number of times to display the dialog to 0. This way, the code for the dialog will come out in the page but the dialog won’t open. Then your button trigger code will open it.

    Please consider donating to support this plugin’s development.

    Perfect that fixed it. Thanks and yes, I’ll donate! Thank you for the prompt response too!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How to Trigger Modal Dialog via Button’ is closed to new replies.