Friday, February 1, 2019

html5 - What does the value attribute mean for checkboxes in HTML?



Suppose this checkbox snippet:




Is it worth?


Is there any reason to statically define the value attribute of checkboxes in HTML? What does it mean?


Answer



I hope I understand your question right.



The value attribute defines a value which is sent by a POST request (i.e. You have an HTML form submitted to a server).
Now the server gets the name (if defined) and the value.





Is it worth?



The server would receive mycheckbox with the value of 1.



in PHP, this POST variable is stored in an array as $_POST['mycheckbox'] which contains 1.


No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...