Change Boolean field status on clicking submit button
I would do it.

function my_custom_submit_function($form, &amp;$form_state)
{
    //if value is 1, then value=0
    if ($form_state['values']['field_test_button']['und'][0]['value']==1) {
        $form_state['values']['field_test_button']['und'][0]['value']=0;
    }
    else 
        //if value is 0, then value=1
        if ($form_state['values']['field_test_button']['und'][0]['value']==0) {
            $form_state['values']['field_test_button']['und'][0]['value']=1;
        }
    //$form_state['values']['field_test_button']['und'][0]['value']=1;
    db_query("UPDATE {field_data_field_test_button} SET field_test_button_value = :val WHERE entity_id = :eid",
             array(':val' =&gt; $form_state['values']['field_test_button']['und'][0]['value'], ':eid' =&gt; $form_state['values']['tid']));
    drupal_set_message(t('Your form has been archieved.'));
}