I am new to magento, here I created the custom module in that Created & Updated field is there. I don't want to show these two fields for this i given disabled=true. but it's displaying.

my code is

$fieldset->addField('created_dt', 'text',
                'label' => 'Created Date',
                'class' => 'required-entry',
                'required' => false,
                'name' => 'created_dt',
                'disabled' => true,
                'value' => date('Y-m-d H:i:s'),

can tell me where I went wrong or how to resolve this?



disabled will only make the form field disabled.
If you want it not visible, instead of type text use hidden. So your field should look like this:

$fieldset->addField('created_dt', 'hidden',
        'name' => 'created_dt',
        'value' => date('Y-m-d H:i:s'),

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.