mirror of https://github.com/dirtbags/moth.git
fix: helper.js was updating form.answer
This commit is contained in:
parent
bae0fb25c6
commit
6045000564
|
@ -21,7 +21,7 @@
|
||||||
<ul id="files"></ul>
|
<ul id="files"></ul>
|
||||||
<p>Puzzle by <span id="authors">[loading]</span></p>
|
<p>Puzzle by <span id="authors">[loading]</span></p>
|
||||||
</section>
|
</section>
|
||||||
<form>
|
<form class="submit-answer">
|
||||||
<label for="answer">Answer:</label>
|
<label for="answer">Answer:</label>
|
||||||
<input type="text" name="answer" id="answer"> <span class="answer_ok"></span>
|
<input type="text" name="answer" id="answer"> <span class="answer_ok"></span>
|
||||||
<br>
|
<br>
|
||||||
|
|
|
@ -211,7 +211,7 @@ async function init() {
|
||||||
window.setanswer = (str => SetAnswer(str))
|
window.setanswer = (str => SetAnswer(str))
|
||||||
window.checkAnswer = (str => window.app.puzzle.IsPossiblyCorrect(str))
|
window.checkAnswer = (str => window.app.puzzle.IsPossiblyCorrect(str))
|
||||||
|
|
||||||
for (let form of document.querySelectorAll("form.answer")) {
|
for (let form of document.querySelectorAll("form.submit-answer")) {
|
||||||
form.addEventListener("submit", formSubmitHandler)
|
form.addEventListener("submit", formSubmitHandler)
|
||||||
for (let e of form.querySelectorAll("[name=answer]")) {
|
for (let e of form.querySelectorAll("[name=answer]")) {
|
||||||
e.addEventListener("input", answerInputHandler)
|
e.addEventListener("input", answerInputHandler)
|
||||||
|
|
Loading…
Reference in New Issue