長(zhǎng)春語林科技
長(zhǎng)春語林科技,您信得過的合作伙伴!
BlogJava
首頁
新隨筆
聯(lián)系
聚合
管理
posts - 325, comments - 25, trackbacks - 0
多個(gè)checkbox radio 是否選中
//第幾個(gè)沒有選
<input type=
"checkbox"
name=
"checkbox1"
checked>
<input type=
"checkbox"
name=
"checkbox1"
>
<input type=
"checkbox"
name=
"checkbox1"
checked>
<input type=
"checkbox"
name=
"checkbox1"
>
<input type=
"checkbox"
name=
"checkbox1"
>
<script language=javascript>
function check(obj)
{
for
(i=
0
;i<document.all(obj).length;i++)
{
if
(!document.all(obj)[i].checked)alert(
"第"
+(i+
1
)+
"個(gè)沒有選擇"
)
}
}
</script>
<input type=button onclick=
"check('checkbox1')"
value=
"檢測(cè)"
>
//一個(gè)也沒有選
<input type=
"checkbox"
name=
"test"
>
<input type=
"checkbox"
name=
"test"
>
<input type=
"checkbox"
name=
"test"
>
<input type=
"checkbox"
name=
"test"
>
<input type=
"checkbox"
name=
"test"
>
<Script Language=
"JavaScript"
>
function check(obj){
for
(i=
0
;i<document.all(obj).length;i++){
if
(document.all(obj)(i).checked){
return
;
}
}
window.alert(
'一個(gè)也沒有選!'
);
}
</Script>
<input type=button onclick=
"check('test');"
value=
"檢測(cè)"
>
//第幾個(gè)沒有選
<input type=
"checkbox"
name=
"checkbox1"
checked>
<input type=
"checkbox"
name=
"checkbox1"
>
<input type=
"checkbox"
name=
"checkbox1"
checked>
<input type=
"checkbox"
name=
"checkbox1"
>
<input type=
"checkbox"
name=
"checkbox1"
>
<script language=javascript>
function check(obj)
{
for
(i=
0
;i<document.all(obj).length;i++)
{
if
(!document.all(obj)[i].checked)alert(
"第"
+(i+
1
)+
"個(gè)沒有選擇"
)
}
}
</script>
<input type=button onclick=
"check('checkbox1')"
value=
"檢測(cè)"
>
//一個(gè)也沒有選
<input type=
"checkbox"
name=
"test"
>
<input type=
"checkbox"
name=
"test"
>
<input type=
"checkbox"
name=
"test"
>
<input type=
"checkbox"
name=
"test"
>
<input type=
"checkbox"
name=
"test"
>
<Script Language=
"JavaScript"
>
function check(obj){
for
(i=
0
;i<document.all(obj).length;i++){
if
(document.all(obj)(i).checked){
return
;
}
}
window.alert(
'一個(gè)也沒有選!'
);
}
</Script>
<input type=button onclick=
"check('test');"
value=
"檢測(cè)"
>
Java代碼
<script language=
"javascript"
>
function checkme()
{ var checkmemberid;
//定義團(tuán)員
var checkcontentid;
//定義文章
checkmemberid=
false
;
checkcontentid=
false
;
//判斷團(tuán)員是否選中
if
(document.all.memberid.checked==
true
)
//只有一個(gè)單選鈕的情況
{
checkmemberid=
true
;
}
for
(i=
0
;i<document.all.memberid.length;i++)
//有一組單選鈕的情況
{
if
(document.all.memberid(i).checked)
{
checkmemberid=
true
;
}
}
//判斷文章是否選中
if
(document.all.contentid.checked==
true
)
//只有一個(gè)單選鈕的情況
{
checkcontentid=
true
;
}
for
(i=
0
;i<document.all.contentid.length;i++)
//有一組單選鈕的情況
{
if
(document.all.contentid(i).checked)
{
checkcontentid=
true
;
}
}
//將結(jié)果返回
if
(checkmemberid==
false
)
{ window.alert(
"請(qǐng)選擇團(tuán)員!"
);
return
false
;
}
else
if
(checkcontentid==
false
)
{
window.alert(
"請(qǐng)選擇文章!"
);
return
false
;
}
return
true
;
}
</script>
posted on 2009-03-09 11:03
長(zhǎng)春語林科技
閱讀(979)
評(píng)論(0)
編輯
收藏
所屬分類:
js
新用戶注冊(cè)
刷新評(píng)論列表
只有注冊(cè)用戶
登錄
后才能發(fā)表評(píng)論。
網(wǎng)站導(dǎo)航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
相關(guān)文章:
yarn
node js后臺(tái)運(yùn)行
node-sass
js檢驗(yàn)寫法 示例
jsonp 調(diào)用示例
js 正則總結(jié)
js分頁
js 打印
js 文件類型判斷
ip input
Copyright ©2025 長(zhǎng)春語林科技 Powered By:
博客園
模板提供:
滬江博客
<
2009年3月
>
日
一
二
三
四
五
六
22
23
24
25
26
27
28
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
長(zhǎng)春語林科技?xì)g迎您!
常用鏈接
我的隨筆
我的評(píng)論
我的參與
最新評(píng)論
留言簿
(6)
給我留言
查看公開留言
查看私人留言
隨筆分類
ajax(2)
android(5)
css(2)
db2(2)
docker(10)
flex(22)
hibernate(16)
html5(9)
java(12)
java8(8)
jquery(4)
js(30)
jsp(2)
jstl(3)
linux(14)
mongodb(1)
mui(1)
mysql(14)
oracle(3)
spring(8)
sqlserver(4)
struts(9)
struts2(13)
tomcat(6)
UML(1)
util(50)
vue(1)
weblogic(1)
隨筆檔案
2020年4月 (1)
2020年3月 (1)
2020年2月 (2)
2019年10月 (2)
2019年9月 (1)
2019年7月 (1)
2019年4月 (1)
2019年1月 (1)
2018年12月 (2)
2018年8月 (1)
2018年6月 (3)
2018年5月 (9)
2018年3月 (9)
2017年12月 (1)
2017年10月 (1)
2017年7月 (1)
2017年6月 (1)
2017年5月 (1)
2017年3月 (3)
2017年2月 (2)
2017年1月 (1)
2016年12月 (1)
2016年11月 (1)
2016年9月 (1)
2016年4月 (3)
2016年3月 (2)
2015年8月 (5)
2015年3月 (1)
2014年8月 (1)
2012年11月 (1)
2012年5月 (2)
2012年4月 (5)
2011年12月 (1)
2011年10月 (3)
2011年9月 (2)
2011年8月 (10)
2011年7月 (3)
2011年6月 (4)
2011年5月 (2)
2011年4月 (3)
2011年3月 (12)
2011年1月 (2)
2010年12月 (1)
2010年9月 (2)
2010年8月 (4)
2010年6月 (1)
2010年4月 (1)
2010年3月 (1)
2009年11月 (1)
2009年9月 (2)
2009年8月 (1)
2009年7月 (2)
2009年6月 (1)
2009年5月 (3)
2009年4月 (8)
2009年3月 (5)
2009年2月 (4)
2009年1月 (2)
2008年12月 (10)
2008年11月 (2)
2008年9月 (10)
2008年8月 (12)
2008年7月 (12)
2008年6月 (3)
2008年5月 (53)
文章分類
java
util(1)
文章檔案
2017年10月 (1)
相冊(cè)
me
收藏夾
store java code
store js code
store other code(2)
搜索
最新評(píng)論
1.?re: js 操作文件[未登錄]
00
--00
2.?re: s:bean.jsp
fdfdsa
--dfasdf
3.?re: hibernate 常用標(biāo)識(shí)生成器
藝達(dá)廣告歡迎您
--藝達(dá)廣告
4.?re: linux mod_jk.so 下載[未登錄]
3Q!
--me
5.?re: weblogic參數(shù)設(shè)置[未登錄]
垃圾
--xx
閱讀排行榜
1.?關(guān)于PreparedStatement插入Date類型值的方法(15471)
2.?myeclipse8.6注冊(cè)碼(轉(zhuǎn)載別人)(9933)
3.?new Date()當(dāng)前日期格式(7657)
4.?weblogic參數(shù)設(shè)置(7522)
5.?js 操作文件(7016)
評(píng)論排行榜
1.?jstl 下載http://www.apache.org/dist/jakarta/taglibs/standard/binaries/(8)
2.?javamail發(fā)送html郵件(3)
3.?powerdisigner 12 下載(3)
4.?struts2 config(1)
5.?sqlserver備份數(shù)據(jù)庫表為.txt文本存儲(chǔ)過程 (感謝同事)(1)
主站蜘蛛池模板:
a级毛片免费完整视频
|
国产免费区在线观看十分钟
|
久久久高清日本道免费观看
|
国产精品亚洲成在人线
|
中国极品美軳免费观看
|
亚洲自偷自偷偷色无码中文
|
全免费a级毛片免费看
|
麻豆亚洲AV永久无码精品久久
|
1000部拍拍拍18免费网站
|
亚洲视频在线观看地址
|
最近2019中文字幕免费大全5
|
亚洲福利视频导航
|
成人在线免费看片
|
亚洲日韩精品A∨片无码加勒比
|
国产伦精品一区二区三区免费下载
|
国产成人亚洲综合a∨
|
国产亚洲精aa成人网站
|
日本在线看片免费
|
色老板亚洲视频免在线观
|
国产亚洲色视频在线
|
国产在线一区二区综合免费视频
|
666精品国产精品亚洲
|
手机在线看永久av片免费
|
男男gay做爽爽免费视频
|
亚洲日韩中文字幕在线播放
|
久久精品毛片免费观看
|
亚洲色www永久网站
|
亚洲成av人片不卡无码久久
|
最近更新免费中文字幕大全
|
亚洲人成电影在线观看网
|
免费一看一级毛片
|
无码精品人妻一区二区三区免费看
|
久久精品视频免费
|
最新亚洲卡一卡二卡三新区
|
亚洲精品NV久久久久久久久久
|
久久免费视频精品
|
色天使亚洲综合一区二区
|
亚洲av永久无码精品古装片
|
最近的免费中文字幕视频
|
亚洲中文无码线在线观看
|
免费jjzz在在线播放国产
|