Skip to content

Instantly share code, notes, and snippets.

@maethu
Last active August 29, 2015 14:01
Show Gist options
  • Save maethu/d90c0e6606a1e9a0ae97 to your computer and use it in GitHub Desktop.
Save maethu/d90c0e6606a1e9a0ae97 to your computer and use it in GitHub Desktop.
<form class="mediothekSuche" action="" method="GET">
<input type="text" name="search_value" placeholder="Suchbegriffe eingeben" style="width: 95%;"/>
<Input type="submit" name="submit" value="Suchen" />
</form>
<script type="text/javascript">
$(function() {
var base = "http://ilu.zhbluzern.ch/F";
var local_base = "local_base=PHZ"; // This is PHZ specific
var params = "&find_code=WVT&func=find-c&ccl_term=(wrd=";
var url = base + '?' + local_base + params;
$('form.mediothekSuche [type="submit"]').bind('click', function(e) {
var search_term = $('form.mediothekSuche [type="text"]').val();
if (!search_term) {
alert('Bitte geben Sie einen oder mehrere Suchbegriffe ein');
} else {
window.open(url + encodeURIComponent(search_term) + ")");
}
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment