Skip to content

Instantly share code, notes, and snippets.

@smith
Created April 28, 2010 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smith/382281 to your computer and use it in GitHub Desktop.
Save smith/382281 to your computer and use it in GitHub Desktop.
// Toggle Input Submit based on whether
// there are ANY input fields showing
function toggleInputSubmit() {
var dis, showit = false;
$$(".tag, .field a").each(function (el) {
el.observe("click", function (event) {
$$(".field").each(function (f) {
dis = f.getStyle("display");
if (dis !== "none") {
showit = true;
throw $break;
} else {
showit = false;
}
});
if (showit) {
$("search_submit").show();
} else {
$("search_submit").hide();
}
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment