php - Checkbox value always getting posted even when not checked -
i adding checkbox form using:
$fieldset->addfield($value, 'checkbox', array( 'label' => $label, 'name' => $value, 'checked' => false, 'onclick' => "", 'onchange' => "", 'value' => $value, 'disabled' => false, 'tabindex' => 1 ));
then in controller doing:
if (isset($this->post[$value])) { $webcategory = $this->post[$value]; if ($webcategory != '') { mage::log("syncing: " . $webcategory); } }
$this->post
mage::app()->getrequest()->getpost()
page. $value
contains id of checkbox (all info dynamic have posted snippets).
the issue have checkbox values getting logged when don't tick them. thought checkboxes weren't posted unless ticked. losing or magento odd?
first check browser: info posted? network tab of browser's debugger (e.g. firebug firefox) tell you. checkboxes info in there?
second, check html: checkbox names defined multiple times? might reason them show in post data.
php magento magento-1.7
No comments:
Post a Comment