Hi there,
I’ve been asking around on stackoverflow to see if someone could come up with a JQuery script to capture the value of a checkbox outside of a form tag and paste it into a hidden input inside the form tag.
I did try that script, which seems legit, but it seems webflow doesn’t take it into consideration.
Does someone have a hint maybe ?
script
$("#reservation").submit(function(evt) {
//handleCheckbox
$("#inside").val($('.outsider:checked').val());
});
Custom form html
<div class="w-form">
<form id="reservation" name="reservation" date-name="reservation" >
<input type="hidden" id="inside" name="inside" date-name="inside" />
<input type="text" id="name" name="name" date-name="name" placeholder="Name please" >
<input type="submit" value="Send" data-wait="Wait..." />
</form>
</div>
Custom html checkbox outside the form
<input type="checkbox" id="outsider" class="outsider" name="outsider" date-name="outsider">
Some screenshots: