Skip to content

Commit

Permalink
Added non empty validation for search form Closes #2181
Browse files Browse the repository at this point in the history
  • Loading branch information
namangupta01 committed Feb 3, 2018
1 parent f52a4f5 commit 809c55e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion app/assets/javascripts/searchform.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@
e.preventDefault()
window.location = '/search/'+$('#searchform_input').val()
});

});

4 changes: 4 additions & 0 deletions app/views/layouts/_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@
</div>
<button type="submit" class="btn btn-primary" style="background:#444;border-color:#222;"><i class="fa fa-search"></i></button>
</form>
<script type="text/javascript">
document.getElementById("searchform_input").setCustomValidity('Please! Type something to search');
</script>


<ul class="nav navbar-nav">

Expand Down

0 comments on commit 809c55e

Please sign in to comment.