I have no trouble populating other fields, but am struggling with populating a select lists #options. Anyone know of a slick way of going about that or have any good reference material?
1 Answer
I'm not sure to understand what do you want but here is a sample of code I've that may answer to your question.
$form['remise'] = array(
'#type' => 'select',
'#options' => array(
0 => t('Sur les catégories & les marques'),
1 => t('Sur les catégories uniquement'),
2 => t('Sur les marques uniquement'),
),
'#title' => t('Remises'),
'#required' => TRUE,
'#default_value' => 0,
);
-
That is close. Will be able to make it work. Thanks for your answer. Jun 3, 2015 at 16:09