Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6639285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:32:09+00:00 2026-05-25T23:32:09+00:00

I am refactoring some code is a Drupal module I wrote sometime age. In

  • 0

I am refactoring some code is a Drupal module I wrote sometime age. In order for others to use it, I am adding a configuration page.

I have successfully defined a fieldset but I don’t know how to ‘insert’ content in to it.
The following code sets up radios for each node type defined on my site:

        $node_types =   node_get_types('names');
    $test   =   array(
        '#title'            =>  t('tweeting node'),
        '#type'             =>  'radios',
        '#options'          =>  $node_types,
        '#default_value'    =>  'Page',
        '#weight'           =>  0,
    );

And the following defines my fieldset into which I want to insert the radio buttons generated above:

        $form['twitterhelper_nodecollection']   =   array(
        '#type'                             =>  'fieldset',
        '#title'                            =>  t('select a node'),
        '#weight'                           =>  0,
        '#collapsible'                      =>  TRUE,
        '#collapsed'                        => FALSE,
        '#parents'  =>  $test,
    );
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:32:09+00:00Added an answer on May 25, 2026 at 11:32 pm

    to add any form element inside the fieldset you should insert this form element inside the field set array …

    E.g

    $form['myfieldset'] = array( 
    '#type' => 'fieldset' , 
    '#collapsible' => TRUE ,
    '#title' => t('My FIeldset'),
    '#attributes' => array('id' => 'myfieldset-id'),
    );
    
    $form['myfieldset']['myradios'] = array(
    '#type' => 'radios' , 
    '#attributes' => array('id' =>'myradio-attributes') , 
    ....etc
    );
    

    so the fieldset is the parent of the radios not the contrast

    hop that help you

    UPDATE:
    you can append the radios inside the field set by using the jquery as the following

    jQuery(document).ready(start) ; 
    function start(){
      jQuery("#myradio-attributes").appendTo("#myfieldset-id"); 
      // i added this id by '#attributes'
    }
    

    but its not the drupal way

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm refactoring some code to use guava Cache . Initial code: public Post getPost(Integer
I am currently refactoring some code which performs Windows Impersonation for testability and have
I'm refactoring some code at the moment and have come across a selector: jQuery(tr,#ctl00_MainContent_MyUserControl).each(function(i,row)
Recently I have been refactoring some of my C# code and I found a
I'm trying to do some refactoring of code, and have run into a problem.
I'm refactoring some code and I have written a method that modifies a Dictionary
I have a peculiar problem. I was tasked with refactoring some old c code
I am currently refactoring some code for work and I have come across some
I'm refactoring some code that a friend wrote and recently stumbled across this function:
I have been looking into refactoring some old code into a new WCF service,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.