当前位置:网站首页>JS judge whether checkbox is selected in the project
JS judge whether checkbox is selected in the project
2022-07-07 09:26:00 【-Coffee-】
<!--js part -->
<script type="text/javascript">
function aa() {var b = false;
var objs = document.getElementsByName("ids");
var a = 0;
var val = "";
for (var i = 0; i < objs.length; i++) {
if (objs[i].checked) {
if (a <= 0) {
b = true;
val = objs[i].value
a = a + 1;
document.getElementById("aaa").href = "Customers/CustomerAction.aspx?id=" + val;
}
if (a > 2) {
alert(' Only one manufacturer can be selected ');
}
}
}
if (a == 0) {
alert(' Please select a manufacturer ');
navTab.reload();
}
}
</script>
<!--Html part -->
<div class="pageContent">
<div class="panelBar">
</div>
<table class="table" width="100%" layoutH="138">
<thead>
<tr>
<th width="22"><input type="checkbox" group="ids" class="checkboxCtrl"></th>
<th width="50" class = "id" > Supplier No </th>
<th align="center" class="style1"> Name of supplier </th>
<th width="100" align="center"> City </th>
<th width="100" align="center"> District and county </th>
<th width="100" align="center"> Customer type </th>
</tr>
</thead>
<tbody>
<asp:Repeater ID="RepeaterTr" runat="server" >
<ItemTemplate>
<tr target="sid_user">
<td><input name="ids" type="checkbox" value="<%#DataBinder.Eval(Container.DataItem, "id")%>" /></td>
<!-- Chinese name 、 English name 、 Picture address -->
<td> <%#DataBinder.Eval(Container.DataItem, "id")%></td>
<td> <%#DataBinder.Eval(Container.DataItem, "customername")%></td>
<td> <%#DataBinder.Eval(Container.DataItem, "provice")%></td>
<td> <%#DataBinder.Eval(Container.DataItem, "city")%></td>
</tr>
</ItemTemplate>
</asp:Repeater>
</tbody>
</table>
</div>
</div>
边栏推荐
- 四、机器学习基础
- Dynamics 365Online ApplicationUser创建方式变更
- MongoDB怎么实现创建删除数据库、创建删除表、数据增删改查
- Unity shader (to achieve a simple material effect with adjustable color attributes only)
- Jmeters use
- 嵌套(多级)childrn路由,query参数,命名路由,replace属性,路由的props配置,路由的params参数
- sqlplus乱码问题,求解答
- stm32和电机开发(从单机版到网络化)
- 章鱼未来之星获得25万美金奖励|章鱼加速器2022夏季创业营圆满落幕
- STM32 and motor development (from stand-alone version to Networking)
猜你喜欢
随机推荐
Jenkins+ant+jmeter use
網易雲微信小程序
LeetCode每日一题(2316. Count Unreachable Pairs of Nodes in an Undirected Graph)
scrapy爬虫mysql,Django等
Add new item after the outbound delivery order of SAP mm sto document is created?
Kubernetes cluster capacity expansion to add node nodes
Information Security Experiment 1: implementation of DES encryption algorithm
数据建模中利用3σ剔除异常值进行数据清洗
Colorbar of using vertexehelper to customize controls (II)
Unity shader (basic concept)
Sublime Text4 download the view in bower and set the shortcut key
Unity shader (data type in cghlsl)
stm32和电机开发(从单机版到网络化)
Detailed learning notes of JVM memory structure (I)
(3/8) method parameters of improper use of enumeration (2)
SiteMesh getting started example
golang select机制和超时问题怎么解决
信息安全实验一:DES加密算法的实现
Over 100000 words_ Ultra detailed SSM integration practice_ Manually implement permission management
Implementation of corner badge of Youmeng message push