Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1 | Red
- 2 | Blue
- 3 | Green
- /**
- * Implements hook_form_FORM_ID_alter().
- */
- function MODULE_NAME_form_YOUR_FORM_ID_alter(&$form, &$form_state) {
- // Replace the next 5 lines with your logic to set the array of values
- $options = array(
- 1 => 'Red',
- 2 => 'Blue',
- 3 => 'Green',
- );
- $form['FORM_ELEMENT_ID']['#type'] = 'select';
- $form['FORM_ELEMENT_ID']['#options'] = $options;
- }
Add Comment
Please, Sign In to add comment