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 < count($resources['subscriptionResources']); $i++){
$resource = $resources['subscriptionResources'][$i];
...
$form['resources'][$resource['resourceID']]['add-qty'] = array(
'#type' => 'radio',
'#title' => t('Upgrade'),
'#return_value' => 1,
'#default_value' => 0,
'#disabled' => FALSE,
'#prefix' => "<table class='upgrade'><tr><td>",
'#suffix' => t("</td>"),
'#attributes' => array(
'name' => '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!