I'm trying to setup a drop down menu, and have the final selection bring you to a URL. I can get the various drop downs working, but the browser doesnt do anything after you make your final selection.
I can get close, but then I lose the ability to hid the other drop downs that don't apply!
<tr>
<td>
<p align="center">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<label for="qmt-vehicle">Vehicle:</label>
<select id="qmt-vehicle" name="vehicle">
<option></option>
<option class="BMW" value="BMW">BMW</option>
<option class="Audi" value="Audi">Audi</option>
</select>
<p align="center">
<label for="qmt-manufacturer">Manufacturer:</label>
<select id="qmt-manufacturer" name="manufacturer">
<option></option>
<option class="BMW" value="http://www.google.com">BMW</option>
<option class="BMW" value="http://www.google.com"> M3</option>
<option class="BMW" value="http://www.google.com"> M5</option>
<option class="Audi" value="Audi">Audi</option>
<option class="Audi" value="http://www.google.com"> A4</option>
<option class="Audi" value="http://www.google.com"> S4</option>
</select>
<script>
$(function() {
$("#qmt-vehicle").on("change", function() {
var levelClass = $('#qmt-vehicle').find('option:selected').attr('class');
console.log(levelClass);
$('#qmt-manufacturer option').each(function() {
var self = $(this);
if (self.hasClass(levelClass)
|| typeof(levelClass) == "undefined") {
self.show();
} else {
self.hide();
}
});
});
});
</script>
<p align="center">
</td>
</tr>