summaryrefslogtreecommitdiff
path: root/http/public/scripts/contact/post-error-message.js
diff options
context:
space:
mode:
authorJoe Carstairs <me@joeac.net>2026-08-13 16:33:51 +0100
committerJoe Carstairs <me@joeac.net>2026-08-13 16:33:51 +0100
commit62e6bab910297aa15d76eb735ce3dd9b5417e26e (patch)
treea98b5fb2c2663e08c21475b1092ccec395e2d87e /http/public/scripts/contact/post-error-message.js
parentf9272fdf3ea23070583c944b110a7b8f16c5a4ff (diff)
remove website/capsule content
Diffstat (limited to 'http/public/scripts/contact/post-error-message.js')
-rw-r--r--http/public/scripts/contact/post-error-message.js34
1 files changed, 0 insertions, 34 deletions
diff --git a/http/public/scripts/contact/post-error-message.js b/http/public/scripts/contact/post-error-message.js
deleted file mode 100644
index 121cbb6..0000000
--- a/http/public/scripts/contact/post-error-message.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/** @typedef {import("./selectors.js").Selectors} Selectors */
-
-/**
- * @param {{contactForm: Selectors}} contactForm
- * @param {string} errorMsg
- */
-export function postErrorMessageOnContactForm({ contactForm }, errorMsg) {
- const errorElem = contactForm.errorElem();
- if (errorElem) {
- errorElem.textContent = errorMsg;
- errorElem.removeAttribute("hidden");
- } else {
- alert(errorMsg);
- }
-}
-
-/**
- * @param {{otpDialog: Selectors}} otpDialog
- * @param {string} errorMsg
- */
-export function postErrorMessageOnOtpForm({ otpDialog }, errorMsg) {
- const errorElem = otpDialog.errorElem();
- if (errorElem) {
- errorElem.textContent = errorMsg;
- errorElem.removeAttribute("hidden");
- } else {
- alert(errorMsg);
- }
- /** @type NodeListOf<HTMLInputElement> */
- const inputs = otpDialog.allOtpInputs();
- for (const input of inputs) {
- input.value = "";
- }
-}