Hello,

I have a custom form element that I want to save in an external database table.

function hook_form(&$node) {
  $form['thumbs']['radios'] = array(
    '#type' => 'radios',
    '#options' => array(
   			1 => 'One',
   			2 => 'Two',
   			3 => 'Three'),
    '#default_value' => 1
    );
}

I would like to know which hook I can use to read the custom form data, and the correct syntax for accessing the '$form['thumb']['radios']' value.

Cheers,

Neal

Comments

smokingtrucks’s picture

I solved this one myself:

I used 'hook_submit' to determine the state of the radio buttons, and write to the db.

The '$form['thumbs']['radios']' element is available through the node object, via '$node->radios'. I was expecting the syntax to be '$node->thumbs['radios'], which caused my initial confusion.