Hi, I am testing out sending a basic form using Netlify with checkbox groups to select multiple checkboxes at once. However, when the form is sent, it only ever returns the last checkbox value selected, not ALL of them.
Right now Iâm using basic html5 markup for the checkboxes (with the same name attribute for them all because they are in a group). Iâve tried removing the extraneous javascript that turns the form into steps, Iâve even tried wrapping them in a fieldset, but no luck.
I am submitting the form using ajax:
$("#main #online-quote-form form").submit(function(e) {
e.preventDefault();
var $form = $(this);
$.post($form.attr("action"), $form.serializeArray()).then(function() {
$("#online-quote-form-message").html("<div>Thank you for your submission! <span>I'll get back to you soon.<a class='btn btn--small btn--success' href='javascript:history.back()'>Take me back</a></span></div>");
$('form').hide();
});
});
Is there something Iâm missing? If I need to implement a javascript-based solution, no problem, but it shouldnât be necessary on basic form submission like this I would think, at least not according to Netlifyâs form documentation.
The submission email should list ALL the checkbox values selected, not just the last one selected.
If anyone can help, Iâd really appreciate it. Thanks so much!