function _ajax_example_get_first_dropdown_options in Examples for Developers 7
Helper function to populate the first dropdown.
This would normally be pulling data from the database.
Return value
array Dropdown options.
Related topics
2 calls to _ajax_example_get_first_dropdown_options()
- ajax_example_dependent_dropdown in ajax_example/
ajax_example.module - AJAX-based dropdown example form.
- ajax_example_dependent_dropdown_degrades in ajax_example/
ajax_example_graceful_degradation.inc - Dropdown form based on previous choices.
File
- ajax_example/
ajax_example.module, line 626 - AJAX Examples module file with basic examples.
Code
function _ajax_example_get_first_dropdown_options() {
// drupal_map_assoc() just makes an array('String' => 'String'...).
return drupal_map_assoc(array(
t('String'),
t('Woodwind'),
t('Brass'),
t('Percussion'),
));
}