Php Magento adminhtml表单字段未添加到POST

Php Magento adminhtml表单字段未添加到POST,php,magento,Php,Magento,我在magento adminhtml表单中有以下字段 在提交时,我希望抓取帖子,并简单地转储它的内容,这是我在saveAction中所做的 public function saveAction() { if ($this->getRequest()->getPost()) { try{ $postData = $this->getRequest()->getPost(); echo '&l

我在magento adminhtml表单中有以下字段

在提交时,我希望抓取帖子,并简单地转储它的内容,这是我在saveAction中所做的

public function saveAction()
{
    if ($this->getRequest()->getPost())
    {
        try{
            $postData = $this->getRequest()->getPost();
            echo '<pre>';
            print_r($postData);
            exit;
“查看我的表格”定义为:

Array
(
    [form_key] => I6jK6swe1EMl0wER
    [carrier_code] => test
    [postcode] => tescode
    [sku] => 123445
    [start_date] => someValue
    [aura] => anotherValue

)
我错过什么了吗?为什么要说日期字段,而不是像所有其他文本输入字段一样添加到帖子中


干杯

您的
addField('start\u date',…)
呼叫中缺少
姓名

要提交的
Varien\u数据表单
的每个字段都需要一个
名称
键/值对


当呈现

时,分配给字段的
名称
键的值将用作相应
元素的
名称
属性的值,因为
addField('start_date',…)
调用中缺少
名称

要提交的
Varien\u数据表单
的每个字段都需要一个
名称
键/值对


当呈现

时,您分配给字段的
名称
键的值将用作相应
元素的
名称
属性的值。如果您删除
选项卡索引
属性,您很想知道
$\u POST
的转储是什么。的
名称
键在哪里
开始日期
?如果删除tabindex属性,结果完全相同。我添加了名称键,然后发现它出现在帖子中!另一个需要第二双眼睛的例子。非常感谢。您是否可以提交一个答复,说明要向表单添加字段并期望它成为过去的一部分,它必须具有名称键。谢谢,我会将此标记为显然正确。很想知道如果删除
tabindex
属性,
start\u date
name
键在哪里?如果删除tabindex属性,结果完全一样。我添加了名称键,然后发现它出现在帖子中!另一个需要第二双眼睛的例子。非常感谢。您是否可以提交一个答复,说明要向表单添加字段并期望它成为过去的一部分,它必须具有名称键。谢谢,我会把这个标记为正确的。
$form = new Varien_Data_Form();
$this->setForm($form);
$fieldset = $form->addFieldset('instance_form', array('legend'=>Mage::helper('instance')->__('Instance Filters')));

    $fieldset->addField('carrier_code', 'text', array(
            'label'     => Mage::helper('instance')->__('Carrier service'),
            'name'      => 'carrier_code',
            'after_element_html' => '<small>Leave blank for all Carriers.</small>',
    ));
    
    $fieldset->addField('postcode', 'text', array(
            'label'     => Mage::helper('instance')->__('Postcode'),
            'name'      => 'postcode',
            'after_element_html' => '<small>Leave blank for all Postcodes.</small>',
    ));
    
    $fieldset->addField('sku', 'text', array(
            'label'     => Mage::helper('instance')->__('Sku'),
            'name'      => 'sku',
            'after_element_html' => '<small>Leave blank for all Skus.</small>',
    ));
    
    $fieldset->addField('start_date', 'date', array(
            'label'     => Mage::helper('instance')->__('Start Date'),
            'after_element_html' => '<small>Comments</small>',
            'tabindex' => 1,
            'image' => $this->getSkinUrl('images/grid-cal.gif'),
            'format' => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT)
    ));
    
    $fieldset->addField('aura', 'file', array(
            'label'     => Mage::helper('instance')->__('Upload'),
            'value'  => 'Uplaod',
            'disabled' => false,
            'readonly' => true,
            'after_element_html' => '<small>Comments</small>',
            'tabindex' => 1
    ));
Array
(
    [form_key] => I6jK6swe1EMl0wER
    [carrier_code] => test
    [postcode] => tescode
    [sku] => 123445
    [start_date] => someValue
    [aura] => anotherValue

)