1

I am trying to make admin form field readonly using below code in protected function _prepareForm().but it also make readonly when add new item.so i would like to make readonly when edit form.

readonly => true,

first time i should able to add text.

MageLerner
  • 179
  • 3
  • 16

1 Answers1

0

You need to put above line based on condition like this,

$modelid = $this->getRequest()->getParam('YOUR KEY');

if($modelid > 0)
{
    readonly => true,
}
Dhiren Vasoya
  • 668
  • 7
  • 20