×

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

作者:Terry2017.02.15来源:Web前端之家浏览:11558评论:0
关键词:JQueryJS
复制代码 代码如下:

.checkboxlistlabel
{
margin-right: 20px;
}

复制代码 代码如下:

var label;
$("#ddlplatFORMinput:Checkbox:checked").each(function () {
label += $(this).next().html();
});

复制代码 代码如下:

<asp:CheckBoxList ID="ddlplatform" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow"
CSSclass="checkboxlist">
<asp:ListItemvalue="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(',');

您的支持是我们创作的动力!
温馨提示:本文作者系Terry ,经Web前端之家编辑修改或补充,转载请注明出处和本文链接:
https://jiangweishan.com/article/svg1487088000783.html

网友评论文明上网理性发言已有0人参与

发表评论: