Heine

  • home
  • drupal
  • drupal core commits
  • about
Home

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;
}


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

Recent posts

  • Planet Drupal past and current
  • Help! - Cannot access a global variable.
  • Why is my module's update hook not listed on update.php's selection form?
  • How do I add a class to a link generated with l()
  • ZeroDayScan - Full path disclosure bug in Drupal 6.16 (0day)
more

Security reviews

  • Afraid custom code makes your site vulnerable?
  • You don't really trust that module you just downloaded from Drupal.org?

Sleep better after a security review.

Tags

Captcha CSRF Drupal embed Input Format modx OpenID Performance Planet Drupal rants Security Varnish
more tags
  • home
  • drupal
  • drupal core commits
  • about

Copyright © 2010 by Heine Deelstra. All rights reserved.