Hi Friend's
Add hidden field in admin form field and get value in controller. first add hidden field in form.php file
$form->addField('created_date', 'hidden',
array(
'name' => 'created_date',
'label' => 'created_date',
'class' => 'required-entry',
'required' => true,
'readonly' => true,
));
Get hidden field value in controller file
$this->getRequest()->getPost('created_date');
Hi vithal, how do we set value for the hidden field?
ReplyDeleteHi Tùng Đào,
DeleteYou can put this code 'value' => 'Your value here'
For Ex.
$form->addField('created_date', 'hidden',
array(
'name' => 'created_date',
'label' => 'created_date',
'class' => 'required-entry',
'required' => true,
'readonly' => true,
'value' => 'Your value here'
));
I haven’t any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us. magento data entry
ReplyDelete