Form API Radio Button Submit I'm building a form that is being built by pulling information from an api and loops through it. The issue I'm having is I cant seem to pass the information to the submit page.

Here is a snippit of my code, let me know if you need more:

// Loop through resources and make fieldset for each.
for($i = 0; $i &lt; count($resources['subscriptionResources']); $i++){  
  $resource = $resources['subscriptionResources'][$i];


...

  $form['resources'][$resource['resourceID']]['add-qty'] = array(
    '#type' =&gt; 'radio',
    '#title' =&gt; t('Upgrade'),
    '#return_value' =&gt; 1,
    '#default_value' =&gt; 0,
    '#disabled' =&gt; FALSE,
    '#prefix' =&gt; "&lt;table class='upgrade'&gt;&lt;tr&gt;&lt;td&gt;",
    '#suffix' =&gt; t("&lt;/td&gt;"),
    '#attributes' =&gt; array(
      'name' =&gt; 'upgrade',
    ),
  );


...
So the outcome is, I get three different forms each with a radio button. They are all connected due to the 'name' attribute, so only one can be selected at any given time.

But when submitting, the default_value stays 0 and return_value stays 1 for all three. I'd like some way to display the information of the 'checked' radio to the submit page. Currently I'm seeing nothing (if default_value is 0) or everything is default_value = 1.

Again, let me know if you need more information.

Thanks!
$resourcids = array();
 // Loop through resources and make fieldset for each.
    for($i = 0; $i &lt; count($resources['subscriptionResources']); $i++){ 
      $resource = $resources['subscriptionResources'][$i];
      $resourcids[$resource['resourceID']]=$resource['resourceID'];
    }      

      $form['resources'] = array(
        '#type' =&gt; 'radios',
        '#title' =&gt; t('Upgrade'),
        '#options' =&gt; $resourcids,
        ),
      );


you dont need to use name attributes. drupal form api give name attributes by form name.

when you submit form you get resource id in form_state['values']['resources'] of which is selected. then you identify which radio button is selected.

and By default disabled is false. so you dont need to add disabled.

dont add t() in before t("

")

'#suffix' =&gt; t("&lt;/td&gt;"),