Linking checkbox status to a function

I’m trying to get a checkbox at the client to link to a function based on a state change. This one line produces the check box and allows toggling of the check icon, but it will not run the SLoopChanged function(). Help please!

client.print ("<input name=“checkbox” onchange=“SLoopChanged();” type=“checkbox” id=“checkbox” />");

No it won't the lines only prints the checkbox, for the checkbox data to be included in a post/get request, the checkbox needs to be part of a form the onchange=\"SLoopChanged();\"is part of Javascript and as far as i know is not supported in C++, so now we have the additional problem that the checkbox data is only part of the request when it has been ticked.