I am trying to create a set of radio buttons that have a link associated with them. This link will popup a secondary window to show the user some information. The radio buttons are created from data brought out of a database.
What is currently happening is that the link that is getting creating is also selecting the radio button. I want this link to be associated with the radio button item but not actually allowed to select the button when clicked.
My question is: How do I add a link to a radio button element, that does not allow the radio button to be selected when the link is clicked.
$form['Classes']['Classes'] = array(
'#type' => 'radios',
'#title' => t('Course Date / Location'),
'#required' => TRUE,
'#options' => $rows
);
here is the definition of the radios type.
The $rows is the information that is created as an array beforehand. I'm currently putting all information into the array. How do I add individual information for each radio button that is a link. This list depends on when it was looked at. If it was looked at in January there would be more information that if it was looked at in February. All the January classes would lot be listed.
Thanks
Comments
...
I'd suggest theming the radios in a table. Something along of:
what would be the best way
what would be the best way of theming that. I like the idea. I think it would work out nicely.
Would I just do the following
instead of the old
...
No, you build the form normally. The theming you do by pointing Drupal, via the '#theme' attribute, to your theming function.
There are several places in Drupal core where radios, or checkboxes, are displayed in a table. One such place is q=admin/settings/filters
There are some examples in the handbooks about theming forms. About tables in particular there's http://drupal.org/node/47582 (See 'dayre's comment).
Here's a simpleminded example I just wrote:
I hard-coded the 'My backyard' etc., because I don't have the time right now for something fancier, so my exmpale is quite crippled. It's just to give you some general idea. Usually you put this extra data in some other form array, as dayre shows at the page I linked to.
Thanks mooffie, That worked
Thanks mooffie,
That worked out great. Exactly what I was looking to do.
Regards