您的位置:首页 > Web前端 > JQuery

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

2018-10-12 14:01 501 查看

.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(',');

您可能感兴趣的文章:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: