我想问为什么drupal没有根据我选择的内容发送价值 看看“Pada JP ke ...”我选择了“6”,当我提交它时
drupal 发送“3”而不是“6”,我的代码在这里
$def = !empty($form_state['values']['jpke']) ? $form_state['values']['jpke'] : 1;
$query1 = db_select('1_jupe', 'jupe')->fields('jupe', array('no'));
$options2 = $query1->execute()->fetchCol();
$form['desc1']['jpke'] = array(
'#type' => 'select',
'#default_value' => $def,
'#title' => t('Pada JP ke ...'),
'#options' => $options2, // the list only has 4 values (1,2,3,6)
);
插入/提交代码
$entry = array(
'jp_ke' => $form_state['values']['jpke'],
'nama_lomba' => $form_state['values']['nama_lomba'],
'kategori' => $form_state['values']['kategori'],
);
$tabel = '1_jp_lomba';
$return = insert_form($entry,$tabel);
dpm($form_state['values']);