This seems to be working... I don't really understand that stuff at the beginning .. I don't know if there's a more efficient way to write it, but it seems to be doing what I want! .. I explained it in a more simplistic way .. this is the actual text that's in the form fields ... Division 3 will show the 3rd and 4th ticket, while division 1 and 2 will only show options for 1 ticket and 2 tickets...
Unless you can think of a more efficient way, .. this works for me!
Thanks for your support!
-Patrick
$(document).ready(function () {
// Run when user makes a selection/element changes
$("#element_16").change(function () {
//refers back to #element_16
var el = $(this);
//Change value to text
$("option").attr("value", function () {
return $(this).text();
});
// if (el.val() contains(2)) {
if (el.val() === "D1W" || el.val() === "D1E" || el.val() === "D1C" || el.val() === "D2E" || el.val() === "D2W" || el.val() === "D2C") {
//Select elements from dropped 2 that contain Division 1
$("#element_26 option:contains(4)").hide();
$("#element_26 option:contains(3)").hide();
} else {
//Show all the elements
$("#element_26 option").show();
}
});
});