Html.RadioButtonListFor problem
- by ognjenb
<%using (Html.BeginForm("Numbers", "Numbers", FormMethod.Post))
{ %>
<table id="numbers">
<tr>
<th>
prvi_br
</th>
<th>
drugi_br
</th>
<th>
treci_br
</th>
</tr>
<%int rb =1; %>"
<% foreach (var item in Model) { %>
<tr>
<td>
<%= Html.Encode(item.prvi_br) %>
<input type="radio" name="<%= Html.Encode(rb) %>" value="<%= Html.Encode(rb) %>" />
</td>
<td>
<%= Html.Encode(item.drugi_br) %>
<input type="radio" name="<%= Html.Encode(rb) %>" value="<%= Html.Encode(rb) %>"/>
</td>
<td>
<%= Html.Encode(item.treci_br) %>
<input type="radio" name="<%= Html.Encode(rb) %>" value="<%= Html.Encode(rb) %>"/>
</td>
</tr>
<% rb++; %>
<% } %>
</table>
<p>
<input type="submit" value="Save" />
</p>
<%} %>
How post this form with only one checked radio button? In my case all of 3 radio buttons is possible to check. How to restrict so that it is possible check only one radio. In this article I found good solutions but it can not be applied because I have a table.