From dc4fa96f9e97fc2cb7a6ec7ad0e70b7c3da02d6b Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Sun, 24 Feb 2019 17:13:26 -0700 Subject: [PATCH] Mention constraint validation API as room for future growth --- theme/puzzle.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/theme/puzzle.js b/theme/puzzle.js index 0781287..eafda60 100644 --- a/theme/puzzle.js +++ b/theme/puzzle.js @@ -161,6 +161,9 @@ function loadPuzzle(categoryName, points, puzzleId) { document.querySelector("input[name=points]").value = points } +// Check to see if the answer might be correct +// This might be better done with the "constraint validation API" +// https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/Form_validation#Validating_forms_using_JavaScript function answerCheck(e) { let answer = e.target.value let ok = document.querySelector("#answer_ok")