CheckBoxList多选样式jquery、C#获取选择项

2019-12-24,,,

复制代码 代码如下:
.checkboxlist label
{
margin-right: 20px;
}

复制代码 代码如下:
var label;
$("#ddlplatform input:checkbox:checked").each(function () {
label += $(this).next().html();
});

复制代码 代码如下:
<asp:CheckBoxList ID="ddlplatform" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow"
CssClass="checkboxlist">
<asp:ListItem Value="APP">APP</asp:ListItem>
<asp:ListItem Value="移动触屏">移动触屏</asp:ListItem>
<asp:ListItem Value="PC">PC</asp:ListItem>
<asp:ListItem Value="微信">微信</asp:ListItem>
<asp:ListItem Value="微博">微博</asp:ListItem>
</asp:CheckBoxList>

复制代码 代码如下:
//使用平台
string Platfrom = string.Empty;
foreach (ListItem li in this.ddlplatform.Items)
{
if (li.Selected)
{
Platfrom += li.Text + ",";
}
}
Platfrom = Platfrom.TrimEnd(',');

您可能感兴趣的文章:

  • layui表格checkbox选择全选样式及功能的实例
  • jQuery实现自定义checkbox和radio样式
  • android开发教程之自定义控件checkbox的样式示例
  • asp.net CheckBoxList各项最小宽度CSS样式(兼容性good)
  • 利用JavaScript更改input中radio和checkbox样式
  • 控制input的CSS但不影响CheckBox以及Radio的样式
  • 用图片替换checkbox原始样式并实现同样的功能

《CheckBoxList多选样式jquery、C#获取选择项.doc》

下载本文的Word格式文档,以方便收藏与打印。