Closed KES777 closed 2 years ago
Thanks for test, do you have an example form?
The normal tests pass successfull for this option -> https://raw.githack.com/brainfoolong/form-data-json/v2-dev/docs/tests/test.html
<form id='ajax-form' action="/" method="GET" class="js-ajax">
<input name='test'>
<button type='submit' class="btn btn-primary">Test form</button>
<input type='submit' class="btn btn-primary" value="Test form"/>
</form>
<input type='submit' class="btn btn-primary" form='regular-form' value="Outer button">
<a type='submit' class="btn btn-primary" form='regular-form'
href="#" role="button"
>Outer link as button</a>
and full page index.html.zip
Your form is not correct in this case. Both <button type='submit'
and <input type='submit'
missing a "name" attribute. <button>
Also miss a value
attribute.
This is standard behaviour, each form element that need to submit a value, must have a name, otherwise nothing is submited (Because of undefined name).
The <button>
need also a value
attribute, which than get's submited (And also picked up by this library)
You are right, I miss the names for my buttons
To Reproduce 1.FormDataJson.toJson( form, { includeButtonValues: true } )