This commit is contained in:
2026-06-04 16:39:43 +03:00
parent 8497fbe2b9
commit e1704af8b4
+6 -6
View File
@@ -265,7 +265,7 @@ export class Validator {
for (const el of [...this.target.elements]) { 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; continue;
} }
@@ -289,7 +289,7 @@ export class Validator {
let uploader = el.dxData('uploader'); let uploader = el.dxData('uploader');
if (uploader) { if (uploader) {
uploader.getFiles().forEach(filename => fdata.append('file__' + el.name + '[]', filename)); uploader.getFiles().forEach(filename => fdata.append(`file__${el.name}[]`, filename));
} }
break; break;
@@ -307,7 +307,7 @@ export class Validator {
case 'checkbox': case 'checkbox':
if (el.checked) { if (el.checked) {
fdata.append(el.name + '[]', value ); fdata.append(`${el.name}[]`, value );
} }
break; break;
@@ -315,7 +315,7 @@ export class Validator {
for (let j = 0; j < el.options.length; j++) { for (let j = 0; j < el.options.length; j++) {
if (el.options[j].selected && el.options[j].value != 0) { 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) ? parseInt(el.options[j].value)
: el.options[j].value : el.options[j].value
); );
@@ -329,7 +329,7 @@ export class Validator {
if (!el.name.endsWith('[]') ) { if (!el.name.endsWith('[]') ) {
fdata.delete(el.name); fdata.delete(el.name);
fdata.append(el.name + '[]', value); fdata.append(`${el.name}[]`, value);
continue; continue;
} }
@@ -341,7 +341,7 @@ export class Validator {
fdata.set(el.name, value); fdata.set(el.name, value);
if (displayedVal) { if (displayedVal) {
fdata.set(el.name + '_value', displayedVal); fdata.set(`${el.name}_value`, displayedVal);
} }
} }
} }