Skip to content

Commit

Permalink
Added non empty validation for search form Closes #2181 (#2182)
Browse files Browse the repository at this point in the history
  • Loading branch information
namangupta01 authored and jywarren committed Feb 5, 2018
1 parent d0c8505 commit e14ea27
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 e14ea27

Please sign in to comment.