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;
|
||||
}
|
||||
|
||||
@@ -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,7 +329,7 @@ export class Validator {
|
||||
|
||||
if (!el.name.endsWith('[]') ) {
|
||||
fdata.delete(el.name);
|
||||
fdata.append(el.name + '[]', value);
|
||||
fdata.append(`${el.name}[]`, value);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ export class Validator {
|
||||
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