Home>Support>Button href #

Button href #

Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].

Hello. I have a question such character, what should I do if in href attribute in buttons I don’t need anything, becouse this button invoke modal window? When I left input URL just blank, button generating with attribute href=”#”. It doesn’t fit for me, becouse when I click on button the page scrolling to the top of the page, every time. Could you help me fix this? Thanks!

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 6 years, 3 months ago Alex S
    Hi, I Work Here

    Hi Oleg,

    The plugin you’re using to add modals to your website will have a few different methods to trigger the modal. You’ll need to set up your Button Destination URL, onclick, class, etc, based on what your modal requires. If your modal plugin doesn’t require a valid URL to be set, it’ll ignore the value used for the Destination URL field so the href being set to # shouldn’t directly affect it. I would check with the developers of the modal to confirm if you need to set a valid Destination URL field or not.

  2. 6 years, 3 months ago Oleg Goretskyi

    One moment in everything, what happened. I don’t use any plugin for adding modals. I create them by myself, and adding to the page by get template part.

  3. 6 years, 3 months ago Alex S
    Hi, I Work Here

    Hi Oleg,

    In that case, you’ll need to update your code to prevent the default action when links are clicked and then trigger your modal code. Unfortunately, this is beyond the scope of what we can help you with on our forums, but you could hire a developer to implement this for you.

    We recommend using Codeable. You’ll be able to hire someone at an hourly rate to do this work for you.

  4. 6 years, 3 months ago Oleg Goretskyi

    Ohh god. Thank you. Prevent default was a key. I just add action in my js funciton and everything working correct. Thank you!

  5. 6 years, 3 months ago Alex S
    Hi, I Work Here

    Hi Oleg,

    Great to hear! :)
    Please be sure to post another thread if you have any other questions.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More