Heine

  • Home
  • Drupal
  • About
Home » Guides » Elements » Comboselect element

Create a simple comboselect element

function example_elements_form() {
  $form = array();
 
  $options = array(
    'one' => t('First Option'),
    'two' => t('Second Option'),
  );
 
  $form['choice'] = array(
    '#type' => 'comboselect',    
    '#title' => t('Example'),
    '#default_options' => $options,
  );
 
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Submit'),
  );
 
  return $form;
}


‹ Comboselect element up Change the 'Other' option ›
  • Printer-friendly version

Recent posts

  • Teampassword manager's password generator is biased
  • Other vectors for SA-CORE-2014-005?
  • Lazy loading: hook_hook_info is for hook owners only.
  • "Always offline" problem in EA's Origin due to antivirus
  • From bug to exploit - Bakery SSO
more

Security reviews

I provide security reviews of custom code, contributed modules, themes and entire sites via LimoenGroen.

Contact us for a quote.

Follow @ustima

Copyright © 2021 by Heine Deelstra. All rights reserved.

  • Home
  • Drupal
  • About