有没有办法从下拉列表或收音机中自动检索选定的值以形成下面的形式?下图中的示例,如果我选择单选按钮“randy”,则值“randy”会自动填写下面的表格 Nama
$header1 = array('Name'); // Prepare table header
$query = db_select("homo", "r"); // Select table
$query->fields("r", array("nama")); // Select fields
$result = $query->execute(); // Execute query
$rows = array();
while($data = $result->fetchObject()){ // Looping for filling the table rows
$rows[] = array( // Fill the table rows
$data->nama,
);
}
$form['table'] = array (
'#type' => 'tableselect',
'#header' => $header1,
'#options' => $rows,
'#multiple' => FALSE,
);
$form['f1'] = array(
'#title' => t('Detail Anggota'),
'#type' => 'fieldset',
);
$form['f1']['namaa'] = array(
'#title' => t('Nama'),
'#type' => 'textfield',
'#required' => TRUE,
);