Update pages.html
Browse files- pages.html +2 -5
pages.html
CHANGED
@@ -513,10 +513,7 @@ editor.Components.addType('custom-form', {
|
|
513 |
form.addEventListener('submit', function(event) {
|
514 |
event.preventDefault();
|
515 |
const formData = new FormData(form);
|
516 |
-
const data =
|
517 |
-
formData.forEach((value, key) => {
|
518 |
-
data[key] = value;
|
519 |
-
});
|
520 |
if (!props.submitUrl) {
|
521 |
console.error('Submit URL is not defined');
|
522 |
return;
|
@@ -526,7 +523,7 @@ editor.Components.addType('custom-form', {
|
|
526 |
headers: {
|
527 |
'Content-Type': 'application/x-www-form-urlencoded'
|
528 |
},
|
529 |
-
body:
|
530 |
})
|
531 |
.then(response => response.json())
|
532 |
.then(data => {
|
|
|
513 |
form.addEventListener('submit', function(event) {
|
514 |
event.preventDefault();
|
515 |
const formData = new FormData(form);
|
516 |
+
const data = new URLSearchParams(formData).toString();
|
|
|
|
|
|
|
517 |
if (!props.submitUrl) {
|
518 |
console.error('Submit URL is not defined');
|
519 |
return;
|
|
|
523 |
headers: {
|
524 |
'Content-Type': 'application/x-www-form-urlencoded'
|
525 |
},
|
526 |
+
body: data
|
527 |
})
|
528 |
.then(response => response.json())
|
529 |
.then(data => {
|