handle placeholder if there is no dropdown selected
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
i<style>
|
<style>
|
||||||
|
|
||||||
body {
|
body {
|
||||||
color: #111;
|
color: #111;
|
||||||
@@ -313,13 +313,17 @@ function customizeSearch(facet) {
|
|||||||
<!-- OneSearch widget script from OLS, modified -->
|
<!-- OneSearch widget script from OLS, modified -->
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function addPrimoQuery(e) {
|
function addPrimoQuery(e) {
|
||||||
// prevent the user from submitting the form if no dropdown item has been selected
|
// prevent the user from submitting the form if no dropdown item has been selected. Added by ME.
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
if (document.getElementById("dropdownMenu1").innerHTML === 'Define Your Search <span class="caret"></span>') {
|
if (document.getElementById("dropdownMenu1").innerHTML === 'Define Your Search <span class="caret"></span>') {
|
||||||
$("#dropdownMenu1").trigger('click.bs.dropdown.data-api');
|
$("#dropdownMenu1").trigger('click.bs.dropdown.data-api');
|
||||||
|
document.getElementById("primoQueryTemp").value = "";
|
||||||
|
document.getElementById("primoQueryTemp").setAttribute("placeholder", "Please make a selection");
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// original OLS widget
|
||||||
document.getElementById("primoQuery").value = "any,contains," + document.getElementById("primoQueryTemp").value.replace(/[,]/g, " ");
|
document.getElementById("primoQuery").value = "any,contains," + document.getElementById("primoQueryTemp").value.replace(/[,]/g, " ");
|
||||||
/* If you changed the form name at the top, change it below to match */
|
/* If you changed the form name at the top, change it below to match */
|
||||||
document.forms["searchPrimoForm1"].submit();
|
document.forms["searchPrimoForm1"].submit();
|
||||||
|
|||||||
@@ -194,7 +194,7 @@
|
|||||||
<h1 id="onesearch-header">OneSearch</h1>
|
<h1 id="onesearch-header">OneSearch</h1>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="dropdown input-group zero-margin">
|
<div class="dropdown input-group zero-margin">
|
||||||
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">Define Your Search <span class="caret"></span></button>
|
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">Define Your Search <span class="caret"></span></button> <!-- keep this as one line, because the JS relies on an exact match -->
|
||||||
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
|
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
|
||||||
<li>
|
<li>
|
||||||
<div class="yamm-content yamm4">
|
<div class="yamm-content yamm4">
|
||||||
|
|||||||
Reference in New Issue
Block a user