Custom fields not saving

I have a need for custom defined radio button groups. The second radio button group is visible when a certain radio button in the first group is selected. I have gotten the radio button groups to display, but the are not saving to the database. I have used the hook_field_info and hook_field_schema functions but I'm not sure I'm implementing them correctly. Any insights would be greatly appreciated.

//Radio Button Group 1
  $form['type1'] = array(
    '#title' => t('Type 1'),
    '#required' => true,	
    '#type' => 'radios',
    '#options' => array(
      'api_type_resource' => t('Description 1)'),
      'api_type_experience' => t('Description 2)'),
      'api_type_utility' => t('Description 3)'),
      'api_type_unknown' => t('Unknown'),),
   '#default_value' => empty($form['nid']['#value']) ? 'unknown_api_type' : 'unknown_api_type',	  
	'#weight' => 3,
  );  
  
  
 //Radio Button Group 2
  $form['type2'] = array(
	'#title' => t('Type 2'),
	'#required' => true,	
	'#type' => 'radios',
	'#options' => array(
	  'doa_owner' => t('Description 1'),
	  'doa_permission' => t('Description 2'),
	  'doa_not_engaged' => t('Description 3'),
	  'doa_unknown' => t('Unknown'),
	),	
   '#default_value' => empty($form['nid']['#value']) ? 'doa_unknown' : 'doa_unknown',
   '#states' => array(
    'visible' => array(
      'input[name="api_type"]' => array('value' => 'api_type_resource'))), 
   '#weight' => 4,   
  );  
  
  
function module_general_field_info() {
   return array(
      'type1' => array( 
          'label' => t('API Type'), 
          'description' => 'some description', 
      ),
      'type2' => array(
         'label' => t('Data Owner Authorization'),
         'description' => 'some description',
      ),
   );
}
  
  
  /**
 * Implements hook_field_schema().
   userID1 - Enhancement 60
 */
function module_general_field_schema($field)
{
    $columns = array(
        'type1' => array(
            'type' => 'varchar',
			'not null' => TRUE,
        ),
        'type2' => array(
            'type' => 'varchar',
			'not null' => TRUE,			
        ),
    );
    return array('columns' => $columns);
}

When I inspect the html elements radio button options I'm not getting an identifier.

An element created in drupal looks like this:
<label class="option" for="field-und-96">Field Label</label>
The custom element looks like this:
<code><label class="option" for="field">My Field Label</label>

0 2 135
2 REPLIES 2

@Dave , Above fields, Are they related to developer app ? When you say database, i believe you are referring to mysql db of drupal. Can you please provide more context where exactly you are using above custom fields ?

These fields are being added in the Dev Portal in a custom.module file (www\sites\all\modules). We are adding fields to track the API Type and Owner of the Data.

We are trying to save these fields to the mysql db of drupal. The fields display on the API Publishing form but will not save because they don't exist in the mysql database. I need to write the fields to the db after displaying them so they can be stored.