js 全选

<form name="frm" method="post" action="/add" onsubmit="return check()">
<table class="titem" >
<tr>
<td class="field"> * 所属批次</td>
<td class="value">
<select name="stockmst_id" id="stockmst_id">
{html_options options=$stockmst_arr selected=$stockmst_id}
</select>
</td>
<td>
&nbsp;&nbsp;<input type="submit" value="提交" id="Btn" />
</td>
<td>
&nbsp;&nbsp;<input type="button" value="返回" onclick="javascript:document.location.href='list?';" />
</td>
</tr>
</table>
</form>
{if $poList}
<form action="/PurchaseOrderCleanLocation/doAdd" method="post" name="form1" onsubmit="return checkBoxSelect()">
<table class="tlist">
<thead>
<tr class="title">
<td><strong><input id="chkAll" type="checkbox" onclick="javascript:checkAll();">全选</strong></td>
<td><strong>所属批次</strong></td>
<td><strong>单号</strong></td>
<td><strong>单名称</strong></td>
<td><strong>类别</strong></td>
<td><strong>状态</strong></td>
</tr>
</thead>
<tbody>
{foreach $poList as $key=>$tpc}
<tr>
<td>
<input type="checkbox" name="pom_ids[]" onclick="javascript:checkChecked();" value="{$tpc.pom_id}" />
</td>
<td>{$tpc.pom_stock_name}</td>
<td>{$tpc.pom_code}</td>
<td>{$tpc.pom_name}</td>
<td>{$tpc.pom_type_name}1</td>
<td>{$tpc.pom_status}</td>
</tr>
{/foreach}
<tr>
<td align="left" colspan="6"><input type="submit" name="sub" value="提交" /></td>
</tr>
</tbody>
</table>
</form>
{/if}
<div>
<script type="text/javascript">
function checkBoxSelect(){
var falg = 0;
$(
"input[name='pom_ids[]']:checkbox").each(function () {
if ($(this).attr("checked")) {
falg
=1;
return false;
}
})
if (falg > 0)
return true;
else {
alert(
"亲,至少要选一项才能提交!");
return false;
}
}
function checkAll()
{
var objCheckAll = document.getElementById("chkAll");
var arrObjInput = document.getElementsByTagName("input");
for(intI = 0 ; intI < arrObjInput.length ; intI ++)
{
if(arrObjInput[intI].type == "checkbox" && arrObjInput[intI].id != "chkAll")
{
if(objCheckAll.checked == true )
{
arrObjInput[intI].checked
= true;
}
else
{
arrObjInput[intI].checked
= false;
}
}
}
}

function checkChecked()
{
var objCheckAll = document.getElementById("chkAll");
var arrObjInput = document.getElementsByTagName("input");
var blnChecked = true;
for(intI = 0 ; intI < arrObjInput.length ; intI ++)
{
if(arrObjInput[intI].type == "checkbox" && arrObjInput[intI].id != "chkAll")
{
if(arrObjInput[intI].checked == false)
{
blnChecked
= false;
}
}
}
objCheckAll.checked
= blnChecked;
}
</script>

转载于:https://www.cnblogs.com/xwblog/archive/2012/02/10/2345032.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/275021.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

结果规格化_结果

结果规格化If you’ve seen an Instagram story involving a question and people tilting their heads, you probably were looking at the “Who Is More” Instagram filter. In this article, I will share the creative process and decision making behind this filter.如…

2021 年 JavaScript 大事记

大家好&#xff0c;我是 ConardLi&#xff0c;不知不觉中&#xff0c;2021 年已经接近尾声了&#xff0c;不知道在 2021 这一年&#xff0c;你收获了什么&#xff1f;又失去了什么呢&#xff1f;又到了开始做年终总结的时候了&#xff0c;今天&#xff0c;我来给 JavaScript 做…

java版spring cloud+spring boot+redis多租户社交电子商务平台 (十三)springboot集成spring cache...

电子商务社交平台源码请加企鹅求求&#xff1a;三五三六二四七二五九本文介绍如何在springboot中使用默认的spring cache&#xff0c;声明式缓存Spring 定义 CacheManager 和 Cache 接口用来统一不同的缓存技术。例如 JCache、 EhCache、 Hazelcast、 Guava、 Redis 等。在使用…

windows符号服务器地址

当调试windows程序的时候&#xff0c;有时候会需要一些符号文件。系统的公有符号文件微软都是提供的&#xff0c;只需在调试器中设置即可&#xff0c;在下次调试时&#xff0c;调试器会自动从网上下载需要的符号文件。可以使用符号文件的调试器有windbg等等。 符号服务器地址&a…

如何融入到更积极的环境,促进技术提升

众所周知&#xff0c;关注公众号可以了解学习掌握技术方向&#xff0c;学习优质好文&#xff0c;落实到自己项目中。还可以结交圈内好友&#xff0c;让自己融入到积极上进的技术氛围&#xff0c;促进自己的技术提升。话不多说&#xff0c;推荐这些优质前端公众号前端之神100w阅…

动画 制作_您希望制作的10个醒目的徽标动画

动画 制作重点 (Top highlight)标志设计 (Logo Design) Have you ever watched paint dry? No? I didn’t think so. How about watched a turtle crossing the road? Probably not. Maybe spent an hour standing in line at the post office? Well that’s pretty likely…

NOIP训练营集训笔记—信息学基础算法(倍增与分治算法

本文摘自清北OI学堂内部笔记&#xff0c;作者潘恺璠&#xff0c;来自柳铁一中曾参加过清北训练营提高组精英班&#xff0c;主要记录的是信息学基础算法。笔记非常详细&#xff0c;特分享给大家&#xff01; NOIP2019年夏令营正在报名中&#xff0c;6大校区10种班型&#xff0c;…

使用 CSS 用户选择控制选择

IE10 平台预览 4 包括一个新的 CSS 属性的支持-ms-user-select&#xff0c;这使得 Web 开发者控制完全可以选择什么的文本&#xff0c;在其网站上更容易。如果你是看我一整天都在我的工作站&#xff0c;您会注意到我读计算机上时&#xff0c;我选择的文本。我不是只有一个人读起…

一个在校的普通前端小姐姐的2021

大家好&#xff0c;我是若川。这是我的源码共读群里一个大三的前端小姐姐&#xff08;小曹同学&#xff09;的年度总结。她写了5篇源码笔记。同时做了很多项目&#xff0c;获得了很多奖。而且策划和建立了学校工作室的前端训练营&#xff0c;40人报名参加。总之就是现在的大学生…

按钮 交互_SwiftUI中的微交互—菜单按钮动画

按钮 交互Microinteractions have become increasingly important in a world with a dizzying number of digital platforms and an ocean of content. While microinteractions used to be considered an interesting resource in the early days of digital design, in toda…

JavaScript逻辑运算符的使用技巧

前言 !, &&, || 三个运算符是JavaScript中重要的逻辑运算符&#xff0c;本文将介绍这三个运算符在JavaScript实际编程中的有趣使用技巧。 取反运算符&#xff08;!&#xff09; 如果对一个值连续做两次取反运算&#xff0c;等于将其转为对应的布尔值&#xff0c;与Bool…

如何接触到最新的前端动态、最前沿的前端技术

众所周知&#xff0c;关注公众号可以了解学习掌握技术方向&#xff0c;学习优质好文&#xff0c;落实到自己项目中。还可以结交圈内好友&#xff0c;让自己融入到积极上进的技术氛围&#xff0c;促进自己的技术提升。话不多说&#xff0c;推荐这些优质前端公众号前端有道社区活…

选择控件— UI组件系列

重点 (Top highlight)The word “toggle” is a reference to a switch with a short handle that alternates between two states each time it is activated. You encounter it every time you “switch” on the lights.单词“ toggle”是指带有短手柄的开关&#xff0c;该开…

linux -- Linux diff与patch的深入分析

diff的输出格式分为传统格式和统一格式 1)diff的传统格式输出. ############################################ cat before.txt 输出: This is a line to be deleted This is a line that will be changed This is a line that will be unchanged cat after.txt 输出: This is …

shell命令之---sed

1. sed编辑器基础 1.1 替换标记 命令格式&#xff1a;s/pattern/replacement/flags $ cat data4.txt    This is a test of the test script.    This is the second test of the test script.    有4种可用的替换标记&#xff1a; 数字&#xff0c;表明新文本将替…

SEE Conf: Umi 4 设计思路文字稿

大家好&#xff0c;我是若川。持续组织了5个月源码共读活动&#xff0c;感兴趣的可以点此加我微信 ruochuan12 参与&#xff0c;每周大家一起学习200行左右的源码&#xff0c;共同进步。同时极力推荐订阅我写的《学习源码整体架构系列》 包含20余篇源码文章。复制此链接 https:…

用户体验改善案例_改善用户体验研究的5种习惯

用户体验改善案例There’s plenty of misunderstanding around user research, whether it’s the concept of validation or one-off anecdotes being thrown around as concrete evidence for a product decision.用户研究存在很多误解&#xff0c;无论是验证的概念还是一次性…

一场赛跑引起的并发知识

享学特邀作者&#xff1a;老顾前言我们小伙伴们是不是经常需要测试代码的性能&#xff1f;小伙伴们是不是就会想到jmeter进行压力测试一下&#xff0c;模拟N个用户同时执行下&#xff0c;看看响应的时间多少。今天老顾就用一个经典的比赛案例&#xff0c;来尝试自行编写个比赛业…

oracle中使用子查询为何取到大于自然数1 rownum 浅度解析

Oracle 没有提供TOP N 语句&#xff0c;若希望按特定条件查询前N 条记录&#xff0c;可以使用伪列ROWNUM。 ROWNUM 是对结果集加的一个伪列&#xff0c;即先查到结果集之后再加上去的一个列(注意&#xff1a;先要 有结果集)。 rownum 的值是oracle 顺序分配的从查询返回的行的编…

巴克莱对冲_“巴克莱的财政预算案”:使金钱管理对心理健康有效—用户体验案例研究

巴克莱对冲Disclaimer: all official Barclays assets used for this project are purely for educational/project purposes only and do not reflect the intentions of Barclays or any of its affiliates.免责声明&#xff1a;用于此项目的所有官方巴克莱资产纯粹是出于教育…