added improvements on set proces and minor other improvements
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user