From 25d91ca2264a1ef0a7a41c0e71c0a1138e764065 Mon Sep 17 00:00:00 2001 From: Ethan Willis Date: Mon, 19 Oct 2015 23:37:59 -0500 Subject: Enhancement of fix for bug #98. Refuses submission of search form if search terms are empty. This avoids an internal server error. --- wqflask/wqflask/templates/index_page.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wqflask/wqflask/templates/index_page.html b/wqflask/wqflask/templates/index_page.html index 6c630344..8b66a5b0 100755 --- a/wqflask/wqflask/templates/index_page.html +++ b/wqflask/wqflask/templates/index_page.html @@ -270,10 +270,13 @@ function pressed(e) { // Has the enter key been pressed? if ( (window.event ? event.keyCode : e.which) == 13) { - // If it has been so, manually submit the
- document.forms[1].submit(); + // If enter key has been pressed and the search fields are non-empty + // manually submit the + if( event.target.value != "" ) { + document.forms[1].submit(); + } } } -{% endblock %} \ No newline at end of file +{% endblock %} -- cgit v1.2.3