summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--site/index.html19
-rw-r--r--todo.org4
2 files changed, 12 insertions, 11 deletions
diff --git a/site/index.html b/site/index.html
index 70d487b..6141163 100644
--- a/site/index.html
+++ b/site/index.html
@@ -172,13 +172,15 @@
let footer = mkElement("section");
let submit = mkElement("button", _("submit"));
- let errormsg = mkElement("p", "", "error");
+ let errormsg = setErrormsg (
+ mkElement("p", "", "error"),
+ null
+ );
appendChildren(footer, [
mkElement("hr"),
submit,
errormsg
]);
- errormsg.hidden = true;
submit.onclick = () => {
// the callback over the complete survey just maps all
// other callbacks to their values, i.e. calls them all
@@ -207,18 +209,17 @@
console.log(response.text())
window.location.href = "thanks.html";
}
- errormsg.innerText = _("Error: post returned error") + "\n"
- + response.status + ": " + response.statusText;
- errormsg.hidden = false;
+ setErrormsg(errormsg,
+ _("Error: post returned error") + "\n"
+ + response.status + ": " + response.statusText
+ );
}).catch(error => {
console.log(error);
- errormsg.innerText = _("Error: could not post");
- errormsg.hidden = false;
+ setErrormsg(errormsg, _("Error: could not post"));
});
} else {
- errormsg.innerText = _("Error: answers invalid");
- errormsg.hidden = false;
+ setErrormsg(errormsg, _("Error: answers invalid"));
}
}
root.appendChild(footer);
diff --git a/todo.org b/todo.org
index 6c5ccb6..f1fb03c 100644
--- a/todo.org
+++ b/todo.org
@@ -5,8 +5,8 @@
** IDEA date picker
* TODO Answer validation
-** TODO general error messages
-** TODO for unchosen radio buttons
+** DONE general error messages
+** DONE for unchosen radio buttons
** IDEA via regular expressions (e.g. for emails)
** IDEA via length