Skip to content

Instantly share code, notes, and snippets.



Created Feb 21, 2019
What would you like to do?
function SearchEnabled() {
if(document.getElementById("ext_search_txt").value==="") {
document.getElementById('ext_search').disabled = true;
} else {
document.getElementById('ext_search').disabled = false;
<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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment