With Multiple Checkbox
How to integrate Checkbox with Web3Forms Properly
There are some confusions on how multiple checkboxes works and how to to integrate it with Web3Forms.
If you simply added a checkbox like this and sent the data to a regular form action, check
would return on
or off
based on whether the user checked or not.
However, if you need to add a value to your checkbox, you need to define it like this:
Now, this would return check: checked
Multiple Checkboxes
You need to add the same name with different values for multiple checkboxes. See:
Web3Forms will then automatically parse them to be comma-separated like this:
Multiple Checkbox with Javascript
If you are using javascript, you have to manually stringify multiple data like this before sending the request to Web3Forms API. See example code:
This will set the checkbox as you intended.
Live Demo
Last updated