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

  • SEARCH
  • Home
  • 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 6674021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:41:48+00:00 2026-05-26T03:41:48+00:00

I am currently working on a custom form module in Drupal 6. In this

  • 0

I am currently working on a custom form module in Drupal 6. In this form I am using a checkboxes field with about 10 different options. The problem I seem to be having is that the only output I get from the checkboxes is “array”. I have spent a couple hours googling like a mad man, and have found numerous tutorials on how to create checkboxes but none really cover what to do with the data once it is entered.

Here is the checkbox code:

$form['message_box']['products'] = array(
    '#type'     => 'checkboxes',
    '#title'    => t('What services are you interested in ?'),
    '#options'  => array(
        'home_and_auto' => t('Home & Auto Insurance'),
        'auto'          => t('Auto Insurance'), 
        'home'          => t('Home Insurance'),
        'other'         => t('Other Personal Insurance'),
        'business'      => t('Business Insurance'),
        'farm'          => t('Farm Insurance'),
        'life'          => t('Life Insurance'),
        'health'        => t('Health Insurance'),
        'rv'            => t('Recreational Vehicle Insurance'),
        'financial'     => t('Financial Services'),
        ),
    '#weight'   => 39
    );      

I’ve set a variable for the array

$products = $form_state['values']['products'];

And the code for the email body:

    $body = 'New quote request from '.$sender.'<br><br>Email Address :'.$valid_email.'<br>'.'Phone No :'.$phone.'<br><br>'.'Address :<br>'.$street.'<br>'.$city.', '.$state.'<br>'.$zip.'<br><br>Interested in the following products<br>'.$products.'<br><br>'.$emessage;

Thanks for whatever assistance you can provide.

  • 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-26T03:41:49+00:00Added an answer on May 26, 2026 at 3:41 am
    $opts = array(
      'home_and_auto' => t('Home & Auto Insurance'),
      'auto'          => t('Auto Insurance'), 
      'home'          => t('Home Insurance'),
      'other'         => t('Other Personal Insurance'),
      'business'      => t('Business Insurance'),
      'farm'          => t('Farm Insurance'),
      'life'          => t('Life Insurance'),
      'health'        => t('Health Insurance'),
      'rv'            => t('Recreational Vehicle Insurance'),
      'financial'     => t('Financial Services'),
    );
    $form['your_possibledynamyc_opts'] = array(
      '#type' => 'value',
      '#value' => $opts,
    );
    
    $form['message_box']['products'] = array(
      '#type'     => 'checkboxes',
      '#title'    => t('What services are you interested in ?'),
      '#options'  => $opts,
      '#weight'   => 39,
    );      
    
    // in submit function
    $products = array();
    foreach ($form_state['values']['your_possibledynamyc_opts'] as $key => $val) {
      if ($form_state['values']['products'][$key]) {
        $products[] = $val;
      }
    }
    $products = implode(', ', $products); // Here text of selected products by comma
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've hit a bit of a problem, I'm currently working on a custom CMS
I am currently working on a form that displays information about a specific product
I'm currently working on several custom ASPX server controls. Of course these controls do
I am currently working on some simple custom allocators in c++ which generally works
SO. I'm working with the OCS UCCAPI, developing a custom OCS client. I'm currently
I had been created text box custom validation control and I'm using this in
I am currently working on a custom SharePoint web part (WSS 3.0, not MOSS)
I'm currently using a custom made library at my job. Until just rencently the
In a custom Form, how does one validate a Model's field's uniqueness (i.e., has
Im currently working on a custom product list in the Magento backend. Heres the

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.