Lormitto
Lormitto

Reputation: 487

select redirection

While considering another problem one question appeared. I do not know how to write html when I want to redirect page when select option changes. In other words user chooses option from select list and page is redirected after that.

Have you met anything like this?

Regards,

Upvotes: 0

Views: 131

Answers (2)

duckbox
duckbox

Reputation: 132

To do something like this, Javascript is required.

You would need to created a onchange function that targets your select dropdown with each select item having a different value, perhaps a url. Or, you can have the url's defined within an array within your function. On getting the url value required, you can you JS to auto-send the link into the url browser, going where you need it to go.

Upvotes: 0

Matthew Flaschen
Matthew Flaschen

Reputation: 284826

You can do this easily with an change event handler; see this example using an inline onchange. You didn't say how to construct the destination URL, though.

Upvotes: 1

Related Questions