Code for embedded search box / widget
This page applies to the new Primo user interface, beginning March 2018
Please "Watch" this page so that we can alert you when there are updates or code changes.
If you had a search widget for the old Primo interface, this is how the new code varies:Â Â
- the action attribute of the form element has changed
- the value of the "vid" input element has changed to HVD2
- a number of the input elements have been removed
- no other changes have been made
Use the following code to embed a search box to HOLLIS. You are welcome to change the style to suite your needs.Â
<script type="text/javascript"> function quickSearchPrimo() { document.getElementById("primoQuery").value = "any,contains," + document.getElementById("primoQueryTemp").value.replace(/[,]/g," "); document.forms["searchPrimoForm"].submit(); } </script> Â <div id="primoQuickSearchWrapper" style="margin-top: -10px;"> <form id="simple" name="searchPrimoForm" method="get" target="_self" style="float:left;" action="https://hollis.harvard.edu/primo-explore/search?" enctype="application/x-www-form-urlencoded; charset=utf-8" onsubmit="quickSearchPrimo()"> <input type="hidden" name="vid" value="HVD2"> <input type="hidden" name="search_scope" value="everything"> <input type="hidden" name="tab" value="everything"> <input type="hidden" name="query" id="primoQuery" > <input type="text" id="primoQueryTemp" value="" size="65" style="height:28px;padding-left:5px;font-size:16px;border-width: 1px;border-style: solid;border-color: #8996A0;"> <input id="go" title="Search HOLLIS+" onclick="quickSearchPrimo()" type="button" value="Search HOLLIS" alt="Search HOLLIS" style="height: 32px; font-size:12px; font-weight:normal; background:#a51c30;color:#ffffff;margin-left: -6px;width: 120px;font-family: Arial, Helvetica, sans-serif;font-style: normal;border-width: 1px;border-style: solid;border-color: #a51c30;border-bottom-width: 0px;"> </form> <div style="clear:both;"> </div> </div> Â