Input drupal 7 select field selected值在渲染形式下不起作用

Input drupal 7 select field selected值在渲染形式下不起作用,input,drupal-7,drupal-render,Input,Drupal 7,Drupal Render,我需要输出一个drupal表单和其他内容。这是我的密码: $outputs="something else"; $outputs.=render(drupal_get_form(quotes_form)); function quotes_form(){ $form = array(); $form['arrival_city_1'] = array( '#default_value' => 'Finland', '#type' => 'select

我需要输出一个drupal表单和其他内容。这是我的密码:

$outputs="something else";
$outputs.=render(drupal_get_form(quotes_form));

function quotes_form(){
  $form = array();
      $form['arrival_city_1'] = array(
    '#default_value' => 'Finland',
    '#type' => 'select',
    '#required' => TRUE,
    '#options'=>array(
        'China' => 'China',
        'Finland' => 'Finland',
    ),
    '#weight'=>2,
    '#suffix'=>'</div>',
);
  return $form;
}
$outputs=“其他东西”;
$outputs.=渲染(drupal_get_形式(引号_形式));
函数引号_form(){
$form=array();
$form['arrival\u city\u 1']=数组(
“#默认_值”=>“芬兰”,
“#键入”=>“选择”,
“#必需”=>正确,
“#选项”=>数组(
“中国”=>“中国”,
“芬兰”=>“芬兰”,
),
“#重量”=>2,
“#后缀”=>”,
);
返回$表格;
}
值“Filand”应为默认值。但是,我检查html输出:

<select id="edit-arrival-city-1" class="form-select required" name="arrival_city_1">
  <option value="China">China</option>
  <option selected="selected" value="Finland">Finland</option>
</select>

中国
芬兰

所选值在代码中是正确的,但“中国”显示在列表字段中。有人知道为什么吗?感谢您在复选框中使用下面的代码。您可以轻松创建SelectBox

$node_schema_type = array('micro_data','json_ld');
foreach($node_schema_type as $key => $value ){
  print $sch_type[$key] = $value;
}

 $form['schema_format'] = array(
    '#type' => 'checkboxes',
    '#options' => drupal_map_assoc(array('micro_data','json_ld')),
    '#default_value' => $sch_type,
    '#title' => t('Add schema type'),
  );

谢谢

你什么意思,你不想在你的html选择列表中选择“中国”?@Prabee我希望列表显示芬兰而不是中国。但它们都在选择列表中。