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
  • #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!

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

    Taufik Nurrohman

    Like this?

    Or this:

     Go to here!


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


    Then go with the Javascript by it self:


    Edit: Rewrote the code a bit.


    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.