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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:45:14+00:00 2026-06-18T14:45:14+00:00

I am adding a checkbox to my form using: $fieldset->addField($value, ‘checkbox’, array( ‘label’ =>

  • 0

I am adding a checkbox to my form using:

$fieldset->addField($value, 'checkbox', array(
                    'label'     => $label,
                    'name'      => $value,
                    'checked' => false,
                    'onclick' => "",
                    'onchange' => "",
                    'value'  => $value,
                    'disabled' => false,
                    'tabindex' => 1
                ));

Then in my controller I am doing:

if (isset($this->post[$value]))
                {
                    $webCategory = $this->post[$value];
                    if ($webCategory != '') {
                        Mage::log("Syncing: " . $webCategory);
                    }
                }

$this->post is the Mage::app()->getRequest()->getPost() from the page. $value contains the id of the checkbox (all the data is dynamic so I have posted snippets).

The issue I have is that the checkbox values are always getting logged even when I don’t tick them. I always thought checkboxes weren’t posted unless they were ticked. Am I losing it or does Magento do something odd?

  • 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-18T14:45:16+00:00Added an answer on June 18, 2026 at 2:45 pm

    First check your browser: What data get POSTed? The network tab of your browser’s debugger (e.g. Firebug for Firefox) will tell you. Are the checkboxes data in there?

    Second, check the HTML: Are the checkbox names defined multiple times? That might be the reason for them to show up in your POST data.

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

Sidebar

Related Questions

I'm using labels for my form, like this : <label for=foo id=bar>Label</label> <input type=checkbox
I am disabling a form based on a checkbox... I am having trouble adding
I have a group of checkboxes using this syntax: echo <form name=\myform\ method=\POST\ action=\csvbuilder.php\>;
I’m making a form with a checkbox where if checked a target file is
I have an gridview that I am adding onclick events to a checkbox column
Im adding dynamically textboxes to my form using jquery like this: $(document).ready(function(){ var i
Can you please help me format this simple_form? I am using this form: <%=
I am modifying a php login form, adding javascript check form function to it.
When using a form like this: <h2> <%:Model.EulaTitle %> </h2> <p> <%=Model.EulaHtml %> </p>
I am trying to make a checkbox in MVC be checked by default. Below

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.