We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2bb7009 commit 01934b2Copy full SHA for 01934b2
src/Resources/public/js/dialog.js
@@ -38,11 +38,9 @@ export default class Dialog {
38
/** @type {HTMLFormElement} */
39
const form = event.target;
40
41
- const formData = new FormData(form);
42
-
43
fetch(form.action, {
44
method: form.method || 'POST',
45
- body: formData,
+ body: new FormData(form),
46
headers: {
47
'X-Requested-With': 'XMLHttpRequest',
48
},
@@ -55,8 +53,10 @@ export default class Dialog {
55
53
})
56
54
.then((result) => {
57
if(result.success) {
+ element.classList.remove('error');
58
element.classList.add('success');
59
} else {
+ element.classList.remove('success');
60
element.classList.add('error');
61
element.querySelector('.ssrn-error-message').innerHTML = result.errors.join('<br>');
62
}
0 commit comments