updates
This commit is contained in:
@@ -263,10 +263,10 @@ export class Validator {
|
||||
|
||||
let fdata = new FormData();
|
||||
|
||||
[...this.target.elements].forEach(el => {
|
||||
for (const el of [...this.target.elements]) {
|
||||
|
||||
if (!el.name || el.type == 'button' || el.type == 'submit') {
|
||||
return true;
|
||||
continue;
|
||||
}
|
||||
|
||||
let value;
|
||||
@@ -327,14 +327,16 @@ export class Validator {
|
||||
|
||||
if (fdata.has(el.name) ) {
|
||||
|
||||
fdata.append(el.name + '[]', fdata.get(el.name) );
|
||||
if (!el.name.endsWith('[]') ) {
|
||||
fdata.delete(el.name);
|
||||
fdata.append(el.name + '[]', value);
|
||||
continue;
|
||||
}
|
||||
else if (fdata.has(el.name + '[]')) {
|
||||
fdata.append(el.name + '[]', value);
|
||||
|
||||
fdata.append(el.name, value);
|
||||
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
|
||||
fdata.set(el.name, value);
|
||||
|
||||
@@ -343,7 +345,6 @@ export class Validator {
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return fdata;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user