Commit 4e8f1b57 by Yvon

4719 - paiement pavé numérique - js WIP

parent 37ab7708
...@@ -511,6 +511,25 @@ $(function() { ...@@ -511,6 +511,25 @@ $(function() {
$("#code-visual").text("*".repeat(code.length)); $("#code-visual").text("*".repeat(code.length));
}); });
$("#code-digits-container").addEventListener('keydown', function (e) {
// Get existing input
let code = $("#formEncaissement_payment_code").val();
if ((e.key >= 48 && e.key <= 57)) {
// Add button value
code += e.key - 48;
} else if (e.key >= 96 && e.key <= 105) {
// Add button value
code += e.key - 96;
} else if (e.key == 8) {
// Remove last char of code
code = code.slice(0, -1);
}
$("#formEncaissement_payment_code").val(code);
// Visual payment code representation
$("#code-visual").text("*".repeat(code.length));
});
$(".payment-code-correction-button").off("click"); $(".payment-code-correction-button").off("click");
$(".payment-code-correction-button").on("click", function() { $(".payment-code-correction-button").on("click", function() {
// Get existing input // Get existing input
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment