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 8748537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:32:30+00:00 2026-06-13T12:32:30+00:00

I have a form in a backend module making use of some dynamically created

  • 0

I have a form in a backend module making use of some dynamically created checkboxes, done thusly:

$allStores = Mage::app()->getStores();
foreach ($allStores as $stores) {
    $store = Mage::app()->getStore($stores);
    $values[] = array('value' => $store->getId(), 'label' => $store->getFrontendName());
}
$fieldset->addField('checkboxes', 'checkboxes', array(
    'label' => 'stuff',
    'name'  => 'boxes',
    'values'=> $values,
));

Now for this particular example I have two stores, with respective IDs 1 and 2. I would assume that this would return an array, or string value containing either 1, 2 or 1 and 2. If I select both boxes, it returns 2, if I select store ID 2, it returns 2, if I select store ID 1, it returns 1. If checkboxes are not what I’m wanting to use here, what do I need to use to obtain multiple values from one field? I assume that this should be capable of it, or it had might as well be radio buttons.

  • 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-06-13T12:32:31+00:00Added an answer on June 13, 2026 at 12:32 pm

    Check your html source

    This is probably yours:

    <input type="checkbox" name="boxes" value="1">1<br>
    <input type="checkbox" name="boxes" value="2">2
    

    This is what it should be:

    <input type="checkbox" name="boxes[]" value="1">1<br>
    <input type="checkbox" name="boxes[]" value="2">2
    

    I don’t know magento but a shot in the dark, I believe you might need to change your code to:

    $fieldset->addField('checkboxes', 'checkboxes', array(
        'label' => 'stuff',
        'name'  => 'boxes[]',
        'values'=> $values,
    ));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form with a dynamically-generated group of fields - backend is php/mySQL,
I use symfony 1.4.11. I have frontend and backend form. Frontend : <?php {
I have form created by the admin generator in the backend of a website.
I have form, where some fields are looks like rows, so I can add/delete
I have a form generator that uses (perl compatible) regexes for ther backend validation.
I have a simple web form and a simple backend table in MySQL. I
I have created a module in Magento which takes certain views from customers about
My ASP.NET application is using SQL Server 2008 backend. I have a Web Form
I have a Django form which I load dynamically to a jQuery dialog after
let's say i have an input form, wherein, it's use for an email address.

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.