1

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 1

1

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,
  );
1
  • That is close. Will be able to make it work. Thanks for your answer. Jun 3, 2015 at 16:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.