about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEthan Willis2015-10-19 23:37:59 -0500
committerEthan Willis2015-10-19 23:37:59 -0500
commit25d91ca2264a1ef0a7a41c0e71c0a1138e764065 (patch)
tree5062f4384ceba550c49d427d5b428dd91f41190f
parent0310301b30c59eca45235cd1bd1ff8e15923950a (diff)
downloadgenenetwork2-25d91ca2264a1ef0a7a41c0e71c0a1138e764065.tar.gz
Enhancement of fix for bug #98. Refuses submission of search form if
search terms are empty. This avoids an internal server error.
-rwxr-xr-xwqflask/wqflask/templates/index_page.html9
1 files 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 <form>
-                document.forms[1].submit();
+                // If enter key has been pressed and the search fields are non-empty
+								// manually submit the <form>			 
+								if( event.target.value != "" ) {										
+									document.forms[1].submit();
+								}
             }
         }
     </script>
 
-{% endblock %}
\ No newline at end of file
+{% endblock %}