I have a choice field type named *sub_choice* in my form whose choices will be dynamically loaded through AJAX depending on the selected value of the parent choice field, na
Suppose for sub choices you have id's right ? Create and empty array with a certain number of values and give it as a choice
$indexedArray = []; for ($i=0; $i<999; $i++){ $indexedArray[$i]= ''; }
then 'choices' => $indexedArray, :)
'choices' => $indexedArray,