0

I want the user to pick from a dropdown menu and their choice then fills the contents of the second menu. When picking from the second menu I want them to be redirected to a url relevant to their choice.

Eg: menu 1 - choices of cars, vans, bikes / menu 2 (if cars is chosen) - choices of audi, bmw, citroen - then when picking audi it goes to the audi site

this needs to be able to work in html and not be a php solution or similar (java etc is fine)

I found this similar query: Populate one dropdown based on selection in another then redirect

but the person who answered assumes a higher level of knowledge than i have and as there isnt a complete answer there with complete code i'm stumped.

I then found this one: directing user to url based on his choice from dropdown menu

It works exactly as i want except it wont work in Internet Explorer (I discovered that after i had implemented it sadly). Any idea on how I can get what I want to happen?

I would post on both of those but moderators delete my questions as apparently you aren't allowed to question incorrect solutions...

Community
  • 1
  • 1

1 Answers1

0

Set the value to the link of the website and after that with a little jquery :

$('#yourdropdown').on('change',function(){
  var where_to = $(this).val();
  window.location = where_to;
});

If you can't set the value to the actual link you ll have to make a switch statement depending on the value define where_to = to the link desired.

Patsy Issa
  • 11,113
  • 4
  • 55
  • 74
  • thanks for that but i dont think i can add a value and my level of coding means i'm a little confused by your answer (sorry) - would you be so kind as to look at the code on this example (in Tad's answer) (http://stackoverflow.com/questions/14048963/directing-user-to-url-based-on-his-choice-from-dropdown-menu?rq=1) and let me know if what you suggest is possible? and if so - how? many thanks! – James Olney Sep 26 '13 at 11:48
  • @JamesOlney Well i am at work for another 3 hours, when i get home i ll take a look at it :) – Patsy Issa Sep 26 '13 at 11:54
  • Thank you. That would be great if you are able to help :) – James Olney Sep 26 '13 at 12:00