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.
Since the checkbox is part of the form, it will be submitted.
You can grab the value by doing $value_of_checkbox = $_POST['checkme'];
Edit, also you should check if the value was set at all beforehand, using something like: if(isset($_POST['checkme'])) { ...
if you clicked the button: you can grap the value by php script. index.php:
var_dump($_POST);
if you did't clicked the button, you can grap the value by javascript. e.g.
<input type='checkbox' name='checkme' value='Yes' onclick="postValue(this.value)"/>
function postValue(var para){
//post the para to php script by ajax that you must master.
}