使用jquery、c#获取checkboxlist选择项,实现如下,感兴趣的朋友可以参考下
PHP代码如下:
.checkboxlist label
{
margin-right: 20px;
}PHP代码如下:
var label;
$("#ddlplatform input:checkbox:checked").each(function () {
label += $(this).next().html();
});PHP 代码如下:
<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>
PHP代码如下:
//使用平台
string Platfrom = string.Empty;
foreach (ListItem li in this.ddlplatform.Items)
{
if (li.Selected)
{
Platfrom += li.Text + ",";
}
}
Platfrom = Platfrom.TrimEnd(',');
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号