Even when the checkbox is unselected it is still returning the Value. I am passing the form through an Ajax request and printing the returned value, but it is the same result checked or unchecked. Isset not working properly either.
<input type="checkbox" value="Agree" id="siteAgreement">
if(!isset($siteAgreement) || !$siteAgreement || $siteAgreement != "Agree"){
//////Unchecked
}
Change
to something like this:
But you should also add the name attribute so browsers with javascript turned off can also use your site.
Also you can use some code that generates request automatically from form (something like jquery.form), so you don’t have to update javascript whenever you change the form.
Example here: http://jsfiddle.net/RhasK/