0
我的頁面中有200個輸入字段。都是單選按鈕5.我怎樣才能得到輸入字段的數據。所有輸入字段的名稱都是從數據庫動態創建的。請幫幫我。從codeignitor中的輸入字段獲取所有表單數據
我的代碼如下
$attributes = array('class' => 'result', 'id' => 'result', 'name' => 'result');
echo form_open('exam/result',$attributes);
$a = array(
'name' => 'aptitude-'.$value->question_id,
'id' => 'answer1',
'value' => 'a',
'checked' => FALSE,
);
$b = array(
'name' => 'aptitude-'.$value->question_id,
'id' => 'answer2',
'value' => 'a',
'checked' => FALSE,
);
$c = array(
'name' => 'aptitude-'.$value->question_id,
'id' => 'answer3',
'value' => 'a',
'checked' => FALSE,
);
$d = array(
'name' => 'aptitude-'.$value->question_id,
'id' => 'answer4',
'value' => 'a',
'checked' => FALSE,
);
$e = array(
'name' => 'aptitude-'.$value->question_id,
'id' => 'answer5',
'value' => 'a',
'checked' => FALSE,
);
$f = array(
'name' => 'aptitude-'.$value->question_id,
'id' => 'answer6',
'value' => 'a',
'checked' => TRUE,
'style' => 'display:none'
);
echo form_radio($a);
echo form_label($value->a, 'a');
echo "<br>";
echo form_radio($b);
echo form_label($value->b, 'b');
echo "<br>";
echo form_radio($c);
echo form_label($value->c, 'c');
echo "<br>";
echo form_radio($d);
echo form_label($value->d, 'd');
echo "<br>";
echo form_radio($e);
echo form_label($value->e, 'e');
echo "<br>";
echo form_radio($f);
echo form_close();
此代碼將200次
在此先感謝