----我解決了單選按鈕問題。現在的問題是我需要發送的值$東西─> quistionNo控制器的答案一起.---codeigniter form_radio()
<?php echo form_open(base_url() . 'things/show');
foreach ($data->result()as $thing) {
echo $thing->questionNo.". ".$thing->question;
$qno =array(
'name' => 'qno',
'id' => 'qno',
'value' => $thing->questionNo
);
//$qno = $thing->questionNo;
var_dump($qno);
?>
<ul>
<li>
<div>
<?php echo form_radio("answer", "1", (set_value("answer") == "1"));
echo $thing->option1; ?>
</div>
</li>
<li>
<div>
<?php echo form_radio("answer", "2", (set_value("answer") == "2"));
echo $thing->option2; ?>
</div>
</li>
<li>
<div>
<?php echo form_radio("answer", "3", (set_value("answer") == "3"));
echo $thing->option3; ?>
</div>
</li>
<li>
<div>
<?php echo form_radio("answer", "4", (set_value("answer") == "4"));
echo $thing->option4; ?>
</div>
</li>
<?php }
echo form_submit(array('name' => 'submit'), 'Submit Answer');
echo form_close();
?>
</body>
</html>
嗨,你可以提供給編碼部的更多信息? – royrui 2011-05-29 14:43:11
謝謝我解決了它,但現在我有新問題 – Aisbd 2011-05-29 17:16:05