将多个单选按钮值发送到控制器Codeigniter
我的调查页面包含
<table class="table">
<form action="What should i write here" method="post">
<?php $numbering = 1;
foreach ($dataQuestion as $key => $value) : ?>
<tr>
<td width="1%"><?= $numbering++; ?></td>
<td><?= $value->question ?>
<div class="form-check mt-1">
<input class="form-check-input" type="radio" name="indikator[$value->id]" value="1">
Very Good
<br>
<input class="form-check-input" type="radio" name="indikator[$value->id]" value="2">
Good
<br>
<input class="form-check-input" type="radio" name="indikator[$value->id]" value="3">
Decent
<br>
<input class="form-check-input" type="radio" name="indikator[$value->id]" value="4">
Bad
<br>
<input class="form-check-input" type="radio" name="indikator[$value->id]" value="5">
Very Bad
</div>
</td>
</tr>
<?php endforeach; ?>
<tr>
<td colspan="2"><button type="submit" class="btn btn-info btn-lg btn-block">Submit</button></td>
</tr>
</form>
我试图使用&lt; form Action =“”&gt;
的每个问题的每个问题的多个问题和广播按钮,但是每个问题都有不同的答案,如何通过&lt; form Action =“”&gt;
将所有回答问题的数组发送给我的控制器?
似乎每个人都喜欢使用JavaScript,URL和form_radio()
。任何帮助将不胜感激,谢谢。
I have survey page containing multiple question and radio button for each question
<table class="table">
<form action="What should i write here" method="post">
<?php $numbering = 1;
foreach ($dataQuestion as $key => $value) : ?>
<tr>
<td width="1%"><?= $numbering++; ?></td>
<td><?= $value->question ?>
<div class="form-check mt-1">
<input class="form-check-input" type="radio" name="indikator[$value->id]" value="1">
Very Good
<br>
<input class="form-check-input" type="radio" name="indikator[$value->id]" value="2">
Good
<br>
<input class="form-check-input" type="radio" name="indikator[$value->id]" value="3">
Decent
<br>
<input class="form-check-input" type="radio" name="indikator[$value->id]" value="4">
Bad
<br>
<input class="form-check-input" type="radio" name="indikator[$value->id]" value="5">
Very Bad
</div>
</td>
</tr>
<?php endforeach; ?>
<tr>
<td colspan="2"><button type="submit" class="btn btn-info btn-lg btn-block">Submit</button></td>
</tr>
</form>
I'm trying to pass selected radio button value to my controller file using <form action="">
but every question have different answer, how to send array of all answered question to my controller via <form action="">
?
It seems everyone prefer to use javascript, url, and form_radio()
. Any help would be appreciated, thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在那写入路由/路径,旨在接收您的http
post
请求。 IE:状态一个路由定义,旨在接收
app \ config \ doutes.php
中的路由。 IE:Write there the route/path meant to receive your HTTP
POST
request. I.e:The state a route definition meant to receive the route in
app\Config\Routes.php
. I.e: