对多个 RadioButton 列表进行分组

发布于 2024-12-04 17:27:47 字数 158 浏览 4 评论 0原文

我的页面上有几个单选按钮列表,每个列表都列出了不同类别下的项目,因此它们列在不同的标题下。

然而,我只想在所有列表中选择一项。

是否可以对列表进行“分组”,以便在情感上表现为一个单选按钮列表?

如果可能的话我想避免使用 jQuery/Javascript

I have several Radio Button lists on my page, each lists items under different categories, so they are listed under different headings.

I only want one item to be selected across all the lists however.

Is it possible to "group" the lists so that the affectively behave as one RadioButton Lists?

I want to avoid using jQuery/Javascript if possible

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

世界和平 2024-12-11 17:27:47

我相信不使用标准 ASP.Net 单选按钮列表控件。最好的办法是在各自的列表中一一呈现单选按钮,当然,设置“名称”属性,以便它们都属于同一组。

您还可以(取决于数据的结构)仅在一个单选按钮列表控件中呈现所有选项,然后使用 css nth 子选择器插入 div/换行符/等。但您可能需要 jQuery 来实现此目的,除非您的目标浏览器仅支持 CSS3。

Not using the standard ASP.Net radio button list control I believe. The best thing to do would be to render out your radio buttons one-by-one in their individual lists and of course, set the "name" property so they all belong to the same group.

You could also (depending on the structure of your data) just render all options in one radio button list control and then use the css nth child selectors to insert divs/line breaks/etc. But you would probably need jQuery for this unless your targeting only browsers that supports CSS3.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文