I have a checkbox like so..
<form action='index.php' method='post'>
<input type='checkbox' name='checkme' value='Yes' />
Include Inactive Keys
</form>
I also have a submit button on the very bottom of the web-page. But when I hit the submit button, I want it to also grab the value of the checkbox (whether it was clicked or not). How can I grab the value?
If you want to see the value of the checkboxes item before submitting it can be accomplish via javascript or jquery.
You can get the value of the checkboxes item by document.getElementsByName(“checkme”)[0].
But still you’ll have difficulty in getting the checkboxes value upon submission of the form unless you’re processing the submission on the same page.
If you process the form submission in the same page you can use the code above to get the value of each checkboxes even those not checked.