Jelajahi Sumber

slight changes

Nicolas Winkler 3 tahun lalu
induk
melakukan
58352755f6
2 mengubah file dengan 13 tambahan dan 3 penghapusan
  1. 11 1
      static/comm.js
  2. 2 2
      static/index.html

+ 11 - 1
static/comm.js

@@ -101,6 +101,16 @@ $(function() {
         }
     });
 
+    $('#word').change(function(ev) {
+        var word = $('#word').val();
+        if (validate_word(word)) {
+            statusMessage("all good");
+        }
+        else {
+            statusMessage("Please use only given characters");
+        }
+    });
+
     $('#guessingform').submit(function(ev) {
         ev.preventDefault();
         var list = getDragAnswers();
@@ -362,4 +372,4 @@ $(function() {
             $('#status').html("");
         }, 4000);
     }
-});
+});

+ 2 - 2
static/index.html

@@ -73,7 +73,7 @@
                 <label for="word">Word:</label>
                 <input id="word" type="text" autocomplete="off" /><br>
                 <input id="submit-word" type="submit" value="Submit Word" />
-            </form>
+           </form>
         </div>
 
         <div id="guessing" style="display:none">
@@ -98,4 +98,4 @@
     </div>
 
 </body>
-</html>
+</html>