Skip to content

HTML Multiple Choice

If you want to handle multiple choice fields in your HTML form, you can use array by adding [ ] to your name attributes.

The sample form should look like this:

<form action="{your-form-endpoint}" method="POST">
<input type="email" name="email">
// Multiple values handle
<input type="checkbox" name="books[]" >
<button type="submit">Send</button>


You should give the same name to both of your checkbox fields’ name attributes. Otherwise, your checkbox values won’t be submitted correctly.