Skip to content

Instantly share code, notes, and snippets.

@dtjohnso
Created March 14, 2011 21:00
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 dtjohnso/869873 to your computer and use it in GitHub Desktop.
Save dtjohnso/869873 to your computer and use it in GitHub Desktop.
Enables keyword searching with a hard-coded subject category on a III Millennium catalog.
<!-- Suggested test search strings: Daniel, puppet, David -->
<script src="http://code.jquery.com/jquery-1.5.js"></script>
<form target="blank" action="http://library.bju.edu/search/X" id="search" style="margin: 0 0 20px 0;">
<input name="search" type="hidden" id="target"/>
<input name="searchscope" value="7" type="hidden" />
<input name="SORT" value="D" type="hidden" />
<input name="userInput" id="userInput" size="30" maxlength="75" /><br/>
<input value="Search" type="submit" />
<input value="Reset" type="reset" />
</form>
<script type="text/javascript">
$('#search').submit( function () {
var userInput = $('#userInput').val();
var hiddenString = "d:(Extension resources) and "
if (userInput === "") return false; //sanity check
$('#target').val(hiddenString + userInput);
return true;
});
</script>
@dtjohnso
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment