Hi all,
I have a jQuery script that will display specific divs depending on which select option has been selected.
Here's the code for that:
jQuery.noConflict();
jQuery(document).ready(function() {
jQuery.viewMap = {
'' : jQuery([]),
'1' : jQuery('.company_1'),
'2' : jQuery('.company_2')
};
jQuery('#companyid').change(function() {
jQuery.each(jQuery.viewMap, function() { this.hide(); });
jQuery.viewMap[jQuery(this).val()].show();
});
});
(example div)
<div class="company_1" style="display: none;">
<input type="checkbox" name="classifications[Miner]" id="classifications[Miner]" /> Spec/Rough
<input type="checkbox" name="classifications[Dealer]" id="classifications[Dealer]" /> Dealer
</div>
I'd like it to clear all the checkboxes inside the div (.company_1, .company_2 etc) if someone selects a different option. If that makes sense? :)
Thank you!