Creating Select options using Drupal

$form[‘value’][‘country1’] = array(
      ‘#type’ => ‘select’,
      ‘#title’ => t(‘Country’),
      ‘#options’ => array(‘au’ => ‘Australia’,’nz’ => ‘Newzeland’),
      ‘#default_value’ => $this->value[‘country1’],
      ‘#process’ => array(‘ctools_dependent_process’),
      ‘#dependency’ => array(‘edit-options-origin’ => array(‘country1’, ‘postal_default’)),
      ‘#weight’ => 4,
      ‘#maxlength’ => 16
    );

List of Countries

    $form[‘value’][‘country’] = array(
      ‘#type’ => ‘select’,
      ‘#title’ => t(‘Country’),
      ‘#options’ => array(” => ”) + location_get_iso3166_list(),
      ‘#default_value’ => $this->value[‘country’],
      ‘#process’ => array(‘ctools_dependent_process’),
      ‘#dependency’ => array(‘edit-options-origin’ => array(‘postal’)),
      ‘#weight’ => 4,
      ‘#attributes’ => array(
        ‘class’ => array(‘location_auto_country’),
      ),
    );

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s