• Hi, there! I’ve been trying to make a simple dropdown selection in wordpress, but it’s not working. My website is an one page woocommerce with some product tables on it. I’ve inserted a anchor link in all those divs and i need a selection dropdown menu. I think i will place it on a sticky header to be always visible on top. So, if you select one of the options, the website scrolls down to the product table you want. I’ve tried to make a dropdown menu, but it’s not the same idea. I need it to show only the selected one, one per time.

    I’ve tried to make a selection option with html, but it needs some jscript, i guess, because every option should have a like and no submit button.

    It would be nice to have something like the image above. https://pasteboard.co/Jk5LaVB.png
    It looks so simple to do, but unfortunately I couldn’t make it work :(((

    Anyone can help me to solve this? thank you so much for your attention.

    • This topic was modified 4 years, 7 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 3 replies - 1 through 3 (of 3 total)
  • You will need to kick off some JavaScript to accommodate this functionality.
    Like this :

    <select onChange="window.location.href=this.value">
        <option value="#headingOne">Option 1</option>
        <option value="#headingTwo">Option 2</option>
    </select>

    Here is a fiddle with separate js and html :
    https://jsfiddle.net/kgzwE/1/

    Thread Starter juliantp77

    (@juliantp77)

    Thank you so much for your reply! Where do I have to place this jscript code in wordpress?

    Thank you! :)))

    This is just straight markup, so you could put in the editor under the Text option (not the HTML option)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Help with simple dropdown selection’ is closed to new replies.