When using .net MVC RadioButtonFor(), how do you group so only one selection can be made?

前端 未结 3 1647
名媛妹妹
名媛妹妹 2020-11-28 09:52

This one has me stumped, I have a strongly typed view that has this loop to generate radiobuttons:

<% foreach (QuestionAnswer qa in Model.QuestionAnswers)         


        
3条回答
  •  北荒
    北荒 (楼主)
    2020-11-28 10:16

    In cases where the name attribute is different it is easiest to control the radio group via JQuery. When an option is selected use JQuery to un-select the other options.

提交回复
热议问题