Heine

  • home
  • drupal
  • about
Home

Change the 'Other' option

function example_elements_form() {
  $form = array();
 
  $options = array(
    'one' => t('First Option'),
    'two' => t('Second Option'),
  );
 
  $form['test'] = array(
    '#type' => 'comboselect',    
    '#title' => t('Example'),
    '#required' => TRUE,
    '#default_options' => $options,
    '#other' => t('None of the above, but'),
  );
 
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Submit'),
  );
 
  return $form;
}

Average: 2 (1 vote)
AttachmentSize
comboselect_other_wording.JPG15.45 KB
‹ Create a simple comboselect element up Tableselect element ›
  • Printer-friendly version

Recent posts

  • In doubt? Read the specs!
  • About the Webform SA
  • Psalmen voor Altblokfluit
  • Unserializing user-supplied data, a bad idea
  • Planet Drupal past and current
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

bladmuziek blood donation blood supply CSRF Drupal Input Format modx MSM Performance Planet Drupal Security Varnish
more tags
  • home
  • drupal
  • about

Copyright © 2011 by Heine Deelstra. All rights reserved.