Skip to content

Instantly share code, notes, and snippets.

@brapse
Created June 8, 2009 21:59
Show Gist options
  • Save brapse/126092 to your computer and use it in GitHub Desktop.
Save brapse/126092 to your computer and use it in GitHub Desktop.
//@jpalardy knows closures
var filterFormFields = (function() {
var mapping = { "0" : "c_refinance",
"1" : "c_home_equity"
"2" : "c_dept_consolidation",
"3" : "c_new_home_purchase" };
return function() {
jQuery("#searchbox > div").hide();
target = mapping[jQuery("#reason").val()];
jQuery("#searchbox ." + target).show();
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment