Textfield value not saving to database I am having a problem with saving values of a textfield in the database.

Usecase:
Users with a certain role should add two things on their accountpage the first time they login.
1.change their password
2.agree with terms.

Point 2 is the trouble part.
I have a text field with two values:
'Agree' and 'Not agree'
Now i like to hide the second option but with my current code the value of the agree option is not getting saved to the database.

Help appreciated
Thanks

Used code

&lt;?php
function regform_form_user_profile_form_alter(&amp;$form, $form_state,  $form_id) {
  global $user;
 // Making password required when role=In between role.
if( ($form_id == 'user_profile_form') and (isset($form['account']['pass'])) and (in_array('In between role', array_values($user-&gt;roles))) ){
    $form['account']['pass']['#type'] = 'password';
    $form['account']['pass']['#required'] = TRUE;
    $form['account']['pass']['#type'] = 'password_confirm';
    $form['account']['pass']['#required'] = TRUE;

   // Disabling and hiding 'Dont agree field' field

  $form['field_agree'] = array(
  '#type' =&gt; 'checkboxes',
  '#options' =&gt; array(
   'Agree' =&gt; t('Agree'),
   'Do not agree' =&gt; t('Do not agree'),

 ),
);
hide($form['field_agree']['Do not agree']);         
 }
}    
?&gt;
It is not necessary to hide the 'no' option from checkbox - just go the the field settings and make it a single on/off checkbox, that way you will not have to deal with this at all.

Then, go to the field settings and set the Default value to off (see screenshot).