Commit ce00307d by Félicie

first commit

parent 71e4b8bb
Pipeline #2424 passed with stage
in 1 minute 23 seconds
......@@ -1230,52 +1230,6 @@ function init() {
$(this).off('wheel.disableScroll');
});
// client-side validation of numeric inputs, optionally replacing separator sign(s).
$("input.number").on("keydown", function (e) {
// allow function keys and decimal separators
if (
// backspace, delete, tab, escape, enter, comma and .
$.inArray(e.keyCode, [
46,
8,
9,
27,
13,
110,
188,
190
]) !== -1 ||
// Ctrl/cmd+A, Ctrl/cmd+C, Ctrl/cmd+X
($.inArray(e.keyCode, [
65,
67,
88
]) !== -1 && (e.ctrlKey === true || e.metaKey === true)) ||
// home, end, left, right
(e.keyCode >= 35 && e.keyCode <= 39)) {
/*
// optional: replace commas with dots in real-time (for en-US locals)
if (e.keyCode === 188) {
e.preventDefault();
$(this).val($(this).val() + ".");
}
// optional: replace decimal points (num pad) and dots with commas in real-time (for EU locals)
if (e.keyCode === 110 || e.keyCode === 190) {
e.preventDefault();
$(this).val($(this).val() + ",");
}
*/
return;
}
// block any non-number
if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) {
e.preventDefault();
}
});
// Manual and textual input
$('#search_input').keypress(function(e) {
if (e.which >= 48 && e.which <= 57) { // figures [0-9]
......
......@@ -59,7 +59,7 @@
</div>
<div class="col-3 center">
<label for="edition_input" id="edition_input_label">Qté : </label>
<input type="text" class="number input_small" id="edition_input" autocomplete="off" required>
<input type="number" class=" input_small" id="edition_input" autocomplete="off" required>
<span id="product_uom"></span>
<i class="fa fa-undo" id="reset_to_previous_qty" style="display:none;"></i>
</div>
......
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