I am adding a select option with below code in my form
$fieldset->addField(
'is_active',
'select',
[
'label' => __('Status'),
'title' => __('Status'),
'name' => 'is_active',
'required' => true,
'options' => ['1' => __('Enabled'), '0' => __('Disabled')]
]
);
Now I need to add default value as 'Enabled'. Adding below line not helping.
'value' => '1'
I checked in vendor/magento/framework/Data/Form/Element/Select.php, below code ( line #57) is having empty value.
$value = $this->getValue();
Dont know if I am missing something. Can someone help?