Skip to content

Instantly share code, notes, and snippets.

@Laim
Created February 21, 2019 17:25
Show Gist options
  • Save Laim/f2125e8458862400603002f24969dcb4 to your computer and use it in GitHub Desktop.
Save Laim/f2125e8458862400603002f24969dcb4 to your computer and use it in GitHub Desktop.
<script>
function SearchEnabled() {
if(document.getElementById("ext_search_txt").value==="") {
document.getElementById('ext_search').disabled = true;
} else {
document.getElementById('ext_search').disabled = false;
}
}
</script>
<form name="form" action="" method="post">
<div class="input-group mb-3 box-shadow">
<input type="text" id="ext_search_txt" name="ext_search" onkeyup="SearchEnabled()" class="form-control" placeholder="<?php print(ExternalSearchPlaceholder);?>" aria-label="<?php print(ExternalSearchPlaceholder);?>" aria-describedby="ext_search">
<div class="input-group-append">
<button class="btn btn-outline-secondary" type="submit" id="ext_search" name="submit" disabled>Search</button>
</div>
</div>
<form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment