Refactor AXO form submission

This commit is contained in:
Pedro Silva 2024-04-15 17:20:02 +01:00
parent 7a5d61bf2b
commit 0cb26c4457
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
6 changed files with 55 additions and 28 deletions

View file

@ -131,8 +131,7 @@ class FormFieldGroup {
return el ? el.value : '';
}
copyDataToForm() {
toSubmitData(data) {
Object.keys(this.fields).forEach((fieldKey) => {
const field = this.fields[fieldKey];
@ -146,11 +145,8 @@ class FormFieldGroup {
return true;
}
jQuery(inputElement).val(
this.dataValue(fieldKey)
);
data[inputElement.name] = this.dataValue(fieldKey);
});
}
}