$_POST is an array of variable names. Let me show you a neat example where this makes sense: Notice how we now have multiple checkboxes, but they all share the same name ("favorite_pet") but different values (e.g. First of all we changed the select element into a series of checkboxes, wrapped in a div with an appropriate class name: Fortunately, this is very simple - just add the checked attribute to the checkbox: In the old days of XHTML, where each attribute should always have a value, even the boolean attributes, it would look like this: Either way should work in all modern browsers, but the first way is shorter and more "HTML5-like". How to get checkbox value in form submission. How to create checkbox in Bootstrap style ? ; Style the label with the width, height, background, margin, and border-radius properties. This is never seen on the client-side, but on the server this is the value given to the data submitted with the checkbox's name. PHP code for saving the checkbox values. Checkboxes can be used as a single checkbox (like an on-ff switch) or as a group of checkboxes where the user can select one or more options. We have the same form as before, but we have added an event handler to each of the checkboxes, which causes them to call a JavaScript function (ValidatePetSelection) when the user clicks them. HTML Checkboxes Selected. Type denotes that it is checkbox c. Checked denotes whether a checkbox is selected or not d. Data-val = "true" and data-val-required= "The Tea field is required." Checkboxes allow you to setup selectable options for your users - either to toggle a single setting on or off, or to allow for multiple choices, like in the Favorite Pet example. Notice how all the checkboxes so far have not been checked from the beginning - the user would have to interact with the checkbox to change its state from unchecked to checked. Create Html page with multiple checkboxes. for defining whether an option is on or off. Checkboxes can be nested inside a