added improvements on set proces and minor other improvements

This commit is contained in:
Stefan
2026-07-13 22:40:08 +02:00
parent 5c0fdc6c1d
commit 5f85b75c22
55 changed files with 1170 additions and 357 deletions
+7 -5
View File
@@ -897,16 +897,16 @@ $ocms.vbl_send = function (ev) {
} else {
val = null;
}
} else if (type === 'number' && typedvalues === true ) {
let v;
} else if ((type === 'number' || dtf[0] === 'float' || dtf[0] === 'integer') && typedvalues === true) {
let v, raw = String(val).replace(',', '.');
if (dtf[0] === 'integer') {
v = parseInt(val);
v = parseInt(raw);
} else {
v = parseFloat(val);
v = parseFloat(raw);
}
val = isNaN(v) ? val : v;
}
if (req === true && ((val || '') === '' || (val.match(pattern) === null))) {
if (req === true && ((val === '' || val === null || typeof val === 'undefined') || (typeof val === 'string' && val.match(pattern) === null))) {
if (cat === false && bool(checkvalidity, false) === true) { e.setCustomValidity(t.nza('ocms-nvnote', $ocms.t.inv || 'Invalid field')); }
val = null;
} else if (cat=== false && bool(checkvalidity, false) === true) {
@@ -2220,6 +2220,8 @@ class NumArray extends Array {
break;
case 'number':
f.pattern = ne(f.pattern, '[-+]?[0-9]*[.,]?[0-9]*');
inp.attr('type', 'text');
inp.attr('inputmode', 'decimal');
inp.attr('step', f.precision || 'any');
inp.attr('data-format', 'float');
break;