How can I update a checkbox from a plugin? I have a plugin that is listening for a form submit.
Within that form are two fields firstName and agreeToTerms.

When the form is submitted, I am updating an existing entry with the values that were posted.

I can get all fields to update except my checkbox. I'm not sure what I need to send to craft if the user has checked the checkbox.

Here is what I have so far:

MyController

$postDateTime = ...

...
$entry-&gt;setContentFromPost(array(
    'agreeToTerms' =&gt; craft()-&gt;request-&gt;getPost('fields.agreeToTerms'),
    'firstName' =&gt; craft()-&gt;request-&gt;getPost('fields.electronicSignature'),
    'signatureDate' =&gt; $postDateTime
));
...


This returns "1" which is the value of the checkbox.

craft()-&gt;request-&gt;getPost('fields.agreeToTerms') // returns 1


But that isn't what I need to send to Craft. If I were using jquery, I am looking for something like

$.prop('checked', true);


EDIT

To help clarify in case someone else comes across this thread, as @carlcs stated I was in fact talking about a checkbox field. 

The plugin I am using allows users to create entries in a section. When an entry is created, one of the fields is a checkbox. I was attempting to set the checkbox field as checked if the user had checked the corresponding checkbox when the entry was created.
If I understand correctly you're talking about a Checkboxes field type. Because you can have multiple checkboxes within such a field, Craft stores an array to the database.

Try if this works:

$entry-&gt;setContentFromPost(array(
    'agreeToTerms' =&gt; array(
        craft()-&gt;request-&gt;getPost('fields.agreeToTerms'),
    )
));