Skip to content
Snippets Groups Projects
Commit 9f2f0a29 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

report validity workaround for mobile

parent 6f7c15be
No related branches found
No related tags found
No related merge requests found
Pipeline #7511 passed
......@@ -41,6 +41,7 @@
},
"revocation": {
"input": {
"error": "Dieses Feld ist erforderlich",
"label": "Ich stimme der Ausführung des Vertrages vor Ablauf der Widerrufsfrist ausdrücklich zu. Ich habe zur Kenntnis genommen, dass das <a href=\"{{revocation_link}}\" target=\"_blank\">Widerrufsrecht</a> mit Beginn der Ausführung des Vertrages erlischt. Stattdessen gewähren wir Ihnen ein freiwilliges <a href=\"{{refundlink}}\" target=\"_blank\">30-tägiges Rückgaberecht</a>."
}
},
......
......@@ -103,6 +103,9 @@
display: grid;
gap: 1rem;
margin: 1rem 0;
> div.error {
display: none;
}
}
#paypal-payment-card #paypal-card-form {
display: grid;
......
......@@ -86,9 +86,14 @@ function get_paypal_checkout_data(funding_source) {
fundingSource: funding_source,
onClick: () => {
let revocation_checkbox = document.getElementById("revocation");
console.log(revocation_checkbox);
if (!revocation_checkbox.checkValidity()) {
revocation_checkbox.reportValidity();
if (!revocation_checkbox.reportValidity()) {
document.querySelector("#revocation-container > div.revocation-required-error").style.display = "block";
}
return;
} else {
document.querySelector("#revocation-container > div.revocation-required-error").style.display = "none";
}
},
createOrder: () => {
......
<div class="error revocation-required-error"><%= req.t("revocation.input.error", {ns: "order"}) _%></div>
<div class="input-group checkbox">
<input type="checkbox" name="revocation" id="revocation" required />
<label for="revocation"><%- req.t("revocation.input.label", {ns: "order", revocation_link: `${baseDir}/agb#revocation`, refundlink: `${baseDir}/agb#refund`}) _%></label>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment