I have created a multi step form, in which I have added radio buttons dynamically by using data from the database. The radio buttons added here are not required. But still I get the following error. I have created a custom module.
An illegal choice has been detected. Please contact the site administrator.
Kindly help me resolve this issue. This is not a duplicate issue. Other issues listed have mentioned that the radios button are used as required field in that case. Please find the code added :
$opt = array(
'f' => 'Friend or Business Associate',
'b' => 'Brochure',
'c' => 'Company',
'a' => 'Another Columbia Asia Hospital',
'ad' => 'Advertisement',
'an' => 'Another Doctor',
);
$step1['questions']['learn_abt'] = array (
'#type' => 'radios',
'#title' => t ( 'In How did you first learn about the Hospital' ),
'#options' => $opt,
);