updates
This commit is contained in:
@@ -265,7 +265,7 @@ export class Validator {
|
||||
|
||||
for (const el of [...this.target.elements]) {
|
||||
|
||||
if (!el.name || el.type == 'button' || el.type == 'submit') {
|
||||
if (!el.name || el.type === 'button' || el.type === 'submit') {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ export class Validator {
|
||||
else {
|
||||
value = el.value.trim();
|
||||
}
|
||||
|
||||
|
||||
switch (el.type) {
|
||||
|
||||
case 'file':
|
||||
@@ -289,7 +289,7 @@ export class Validator {
|
||||
let uploader = el.dxData('uploader');
|
||||
|
||||
if (uploader) {
|
||||
uploader.getFiles().forEach(filename => fdata.append('file__' + el.name + '[]', filename));
|
||||
uploader.getFiles().forEach(filename => fdata.append(`file__${el.name}[]`, filename));
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -307,7 +307,7 @@ export class Validator {
|
||||
case 'checkbox':
|
||||
|
||||
if (el.checked) {
|
||||
fdata.append(el.name + '[]', value );
|
||||
fdata.append(`${el.name}[]`, value );
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -315,7 +315,7 @@ export class Validator {
|
||||
|
||||
for (let j = 0; j < el.options.length; j++) {
|
||||
if (el.options[j].selected && el.options[j].value != 0) {
|
||||
fdata.append(el.name + '[]', /^\d+$/.test(el.options[j].value)
|
||||
fdata.append(`${el.name}[]`, /^\d+$/.test(el.options[j].value)
|
||||
? parseInt(el.options[j].value)
|
||||
: el.options[j].value
|
||||
);
|
||||
@@ -329,19 +329,19 @@ export class Validator {
|
||||
|
||||
if (!el.name.endsWith('[]') ) {
|
||||
fdata.delete(el.name);
|
||||
fdata.append(el.name + '[]', value);
|
||||
fdata.append(`${el.name}[]`, value);
|
||||
continue;
|
||||
}
|
||||
|
||||
fdata.append(el.name, value);
|
||||
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
fdata.set(el.name, value);
|
||||
|
||||
if (displayedVal) {
|
||||
fdata.set(el.name + '_value', displayedVal);
|
||||
fdata.set(`${el.name}_value`, displayedVal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user