Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Dynamic Link via Select

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #39109

    I need for there to be a way for the user to select an option, from a form, obviously using the select and option elements in HTML, then dynamically changing the href of an anchor link. If there is a better way to do this, I am definitely open to any suggestions. I would prefer that it be done in PHP, however, like I said, I am also open to other languages.
    Thanks much!

    EDIT:
    The links will also be to an external site, not the one I am working on.

    #106921
    Taufik Nurrohman
    Participant

    Like this?

    http://jsfiddle.net/tovic/2WLCU/5/

    Or this:

     Go to here!

    http://jsfiddle.net/tovic/2WLCU/7/

    #106927
    agrimsrud
    Participant

    I’d recommend not using inline javascript. Try something like:

    ​​​
    Example.com

    Then go with the Javascript by it self:

    Or:

    Edit: Rewrote the code a bit.

    #106931

    Thank you both a bunch, this works great, but is there any way I can do your way with multiple selects on the same page, without rewriting the code a bunch of times? I am not the greatest when it comes to JavaScript. Thanks again!

    Edit: they are all each in their own div also.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Back End’ is closed to new topics and replies.