Skip to content

Instantly share code, notes, and snippets.

@kaoskeya
Created May 12, 2015 10:50
Show Gist options
  • Save kaoskeya/7e85d468b3260f4b6040 to your computer and use it in GitHub Desktop.
Save kaoskeya/7e85d468b3260f4b6040 to your computer and use it in GitHub Desktop.
Scrap 3 dependant dropdowns
a = [];
$("#cboDivision option").each(function(indd, d){ if( $(d).val() != 0 ) {
$("#cboDivision").attr('selectedIndex', indd).trigger("change");
$("#cboSubDivision option").each(function(inds, sd){ if( $(sd).val() != 0 ) {
$("#cboSubDivision").attr('selectedIndex', inds).trigger("change");;
$("#cboPoliceStation option").each(function(indp, e){ if( $(e).val() != 0 ) a.push({ "division": $("#cboDivision").val().trim(), "subdivision": $("#cboSubDivision").val().trim(), "policestation": $(e).text().trim() }) } );
}});
}});
copy(a);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment