How do I see if HTML checkbox is checked

Hi

In running a webserver with a basic form where I store the input values from the different fields on submit, but I can't seem to get it right with checkboxes.

I wan't to store the state of the checkbox - something along the lines of this code:

if (ifttt_active.IsChecked) 
{
  // Do something
} else {
  // Do someting else
}

But is that even possible? Or do we need some kind of "ninjatricks" to get it working?
Thanks

But is that even possible?

No. The data returned by the client, in the form of a new GET request does not have an IsChecked property.

Or do we need some kind of "ninjatricks" to get it working?

No. You need (to post) some code. You need to Serial.print() the GET request. You can't hope to parse unknown data.

With a checkbox, the GET or POST request sends not value at all if the box is not checked, and sends a value ('on', I think, or maybe the value) if it is checked.

So if your form has a name, othername, and checkbox 'ok', then the incoming request

GET /myform?name=foo&othername=bar HTTP/1.1

means 'ok' was not checked and the incoming request

GET /myform?name=foo&othername=bar&ok=on HTTP/1.1

means it was.

Spec is here: www.w3.org/TR/html401/interact/forms

The below site might have some info for you. Note that if someone else accesses the server and changes whatever is being controlled, your check box will no longer represent the current status of the device.

http://startingelectronics.org/tutorials/arduino/ethernet-shield-web-server-tutorial/web-server-LED-control/