I have this form:
<form action="#" method="POST" class="form-ajax-submit-onchange">
<input type="text" name="test" value="" placeholder="test" />
</form>
But it POSTS only [object Object].
How can I fix this?
I’m using F7v8.3.0.
I have this form:
<form action="#" method="POST" class="form-ajax-submit-onchange">
<input type="text" name="test" value="" placeholder="test" />
</form>
But it POSTS only [object Object].
How can I fix this?
I’m using F7v8.3.0.
I fixed my problem by modifying the core framework7-bundle.js file. However, I don’t want to have to make this change every time there’s a Framework7 update. Is there a better way to retrieve the field values?
This is my modification:
framework7-bundle.js, code line 20175
if (method === 'POST') {
if (contentType === 'application/x-www-form-urlencoded' || contentType === 'application/json') {
//data = app.form.convertToData($formEl[0]);
data = serializeObject(app.form.convertToData($formEl[0])); // CHANGED BY FLORIS ON 2-10-2023 TO POST FORMFIELDS
if (contentType === 'application/json') {
data = JSON.stringify(data);
}
} else {
data = new window.FormData($formEl[0]);
}
}