I understand how to add stuff like checkboxes and fieldsets to existing forms (e.g. the form displayed on the node edit page) using _form_alter. But what I don't understand is how to collect the input and store it in a database table of my choosing (ideally with db_insert). Let's say I've added a checkbox to the fieldsets at the bottom of article_node_form (the form which appears when editing content type article):
$form["Email Notifications"] = array( '#type' => 'fieldset', '#title' => 'Email Notifications', '#collapsible' => 'true', '#group' => 'additional_settings', '#required' => FALSE, 'email_notify' => array ( '#type' => 'checkbox', '#title' => 'Notify users of changes to this page', '#default_value' => 0, '#required' => FALSE, )
How do I collect this data an store it in a database?