Last active
December 3, 2015 18:41
-
-
Save DeskWOW/23e7093bfae7d7fb9aba to your computer and use it in GitHub Desktop.
Example dependent dropdown code for support center / widget contact form.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
.hidden { | |
display: none; | |
} | |
</style> | |
<div class="div-category"> | |
{{ ticket_custom_category }} | |
</div> | |
<div class="div-subcategory hidden"> | |
{{ ticket_custom_subcategory }} | |
</div> | |
<script> | |
$(function() { | |
$(".div-category select").on("change", function() { | |
if ($(this).val() == "Alpha") { | |
$(".div-subcategory select").show(); | |
} else { | |
$(".div-subcategory select").hide(); | |
} | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment