small fixes

This commit is contained in:
Ricardo (XenGi) Band 2025-01-23 14:21:51 +01:00
commit 70450a8774
No known key found for this signature in database
2 changed files with 6 additions and 5 deletions

View file

@ -79,7 +79,7 @@
<div id="iban" class="field"> <div id="iban" class="field">
<label for="input-iban" class="label">Receiver IBAN</label> <label for="input-iban" class="label">Receiver IBAN</label>
<div class="control has-icons-right"> <div class="control has-icons-right">
<input id="input-iban" class="input" type="text" placeholder="Receiver IBAN" value="" required> <input id="input-iban" class="input" type="text" value="" required>
<span class="icon is-small is-right"></span> <span class="icon is-small is-right"></span>
</div> </div>
</div> </div>
@ -87,7 +87,7 @@
<div id="bic" class="field"> <div id="bic" class="field">
<label for="input-bic" class="label">Receiver BIC</label> <label for="input-bic" class="label">Receiver BIC</label>
<div class="control has-icons-right"> <div class="control has-icons-right">
<input id="input-bic" class="input" type="text" placeholder="Receiver BIC" value="" required> <input id="input-bic" class="input" type="text" value="" required>
<span class="icon is-small is-right"></span> <span class="icon is-small is-right"></span>
</div> </div>
</div> </div>
@ -95,7 +95,7 @@
<div id="amount" class="field"> <div id="amount" class="field">
<label for="input-amount" class="label">Amount</label> <label for="input-amount" class="label">Amount</label>
<div class="control has-icons-left has-icons-right"> <div class="control has-icons-left has-icons-right">
<input id="input-amount" class="input" type="number" min="0.00" step="0.01" value="0.00" pattern="[0-9]+.[0-9]{2}" required> <input id="input-amount" class="input" type="number" min="0.00" step="0.01" value="0.00" pattern="[0-9]+.[0-9]{2}" placeholder="0.00" required>
<span class="icon is-small is-left"><b>&euro;</b></span> <span class="icon is-small is-left"><b>&euro;</b></span>
<span class="icon is-small is-right"></span> <span class="icon is-small is-right"></span>
</div> </div>
@ -104,7 +104,7 @@
<div id="purpose" class="field"> <div id="purpose" class="field">
<label for="input-purpose" class="label">Purpose</label> <label for="input-purpose" class="label">Purpose</label>
<div class="control has-icons-right"> <div class="control has-icons-right">
<input id="input-purpose" class="input" type="text" placeholder="Purpose" value="" maxlength="140" required> <input id="input-purpose" class="input" type="text" placeholder="Pizza night!" value="" maxlength="140" required>
<span class="icon is-small is-right"></span> <span class="icon is-small is-right"></span>
</div> </div>
</div> </div>

View file

@ -95,7 +95,8 @@ validateIban = (target) => {
} }
validateAmount = (target) => { validateAmount = (target) => {
if (parseFloat(target.value) > 0) { if (parseFloat(target.value) > 0 && target.value.toString() === parseFloat(target.value).toFixed(2).toString()) {
target.value = parseFloat(target.value).toFixed(2);
target.classList.remove("is-danger") target.classList.remove("is-danger")
document.querySelector("#amount div span.is-right").innerHTML = "&#x2705;"; document.querySelector("#amount div span.is-right").innerHTML = "&#x2705;";
} else { } else {