zoukankan
html css js c++ java
js代码控制dropdownList
<!
DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"
>
<
html
>
<
head
>
<
title
></
title
>
<
script
language
="JavaScript"
type
="text/javascript"
>
<!--
//
by Vic Phillips http://www.vicsjavascripts.org.uk
//
elements in the form are numbered from the top 0 to
//
The select option value specifies the element numbers to disable separated by '^'
function
Select(f,s)
{
el
=
f.elements;
for
(i
=
0
;i
<
el.length;i
++
)
{
//
el[i].style.visibility='visible';
el[i].removeAttribute('disabled');
}
if
(s.selectedIndex
<
1
)
{
return
; }
selop
=
s.options[s.selectedIndex].value.split('
^
');
for
(i
=
0
;i
<
selop.length;i
++
)
{
if
(el[selop[i]])
{
//
el[selop[i]].style.visibility='hidden';
el[selop[i]].setAttribute('disabled','disabled');
}
}
}
function
Radio(f,s)
{
el
=
f.elements;
for
(i
=
0
;i
<
el.length;i
++
)
{
//
el[i].style.visibility='visible';
el[i].removeAttribute('disabled');
}
if
(s.selectedIndex
<
1
)
{
return
; }
selop
=
s.value.split('
^
');
for
(i
=
0
;i
<
selop.length;i
++
)
{
if
(el[selop[i]])
{
//
el[selop[i]].style.visibility='hidden';
el[selop[i]].setAttribute('disabled','disabled');
}
}
}
//
-->
</
script
></
head
>
<
body
>
<
form
>
<
select
name
=""
size
="1"
onchange
="Select(this.form,this);"
>
<
option
value
=" "
>
Select
</
option
>
<
option
value
="1"
>
Hide TB1
</
option
>
<
option
value
="1^3"
>
Hide TB1 & 3
</
option
>
<
option
value
="2^3^4"
>
Hide TB2,3,4
</
option
>
<
option
value
=""
>
Hide None
</
option
>
</
select
>
<
input
name
=""
size
="10"
value
="123"
>
<
input
name
=""
size
="10"
value
="234"
>
<
input
name
=""
size
="10"
value
="345"
>
<
input
name
=""
size
="10"
value
="456"
>
<
input
type
="radio"
name
="fred"
value
="1"
onclick
="Radio(this.form,this);"
>
<
input
type
="radio"
name
="fred"
value
="1^3"
onclick
="Radio(this.form,this);"
>
<
input
type
="radio"
name
="fred"
value
="2^3^4"
onclick
="Radio(this.form,this);"
>
<
input
type
="radio"
name
="fred"
value
=""
onclick
="Radio(this.form,this);"
><
br
>
</
form
>
</
body
>
</
html
>
<
select
name
="first"
id
="first"
onchange
="if(this.value == 'no') document.getElementById('sec').disabled=true; else document.getElementById('sec').disabled=false;"
>
<
option
value
="yes"
>
Yes
</
option
>
<
option
value
="no"
>
No
</
option
>
</
select
>
<
br
/><
br
/>
<
select
name
="sec"
id
="sec"
>
<
option
value
="yes"
>
Yes
</
option
>
<
option
value
="no"
>
No
</
option
>
</
select
>
查看全文
相关阅读:
(数据看成字符串)大端——高尾端,小端——低尾端链接
ASP.NET 页生命周期概述
asp.net web 开发登录相关操作的控件LoginName、LoginStatus和LoginView控件使用详解
Server.MapPath()目录详解
C# ASP.NET FILEUPLOAD详解
HTML中id、name、class 区别
注册表新建 -------DWORD(32-位)
XSD标准架构-----<xsd:element> 元素详解
html5学习链接
关于HSL和HSV颜色空间的详细论述
原文地址:https://www.cnblogs.com/simhare/p/877569.html
最新文章
拷贝构造函数(深拷贝vs浅拷贝)
QTP自带订票实现循环执行,參数化和将异常提示信息输出
lpad&rpad
JS冒泡和闭包案例分析
hdu 4997 Biconnected
java.lang.Exception: Socket bind failed
SqlHelper——仅仅由于在人群中多看了你一眼
mysql Access denied for user 'root'@'localhost' (using password: YES)
HDU1312 / POJ1979 / ZOJ2165 Red and Black(红与黑) 解题报告
iOS 相似QQ空间表视图下拉头部视图放大效果实现
热门文章
2.5星|《重启》:日本市场的30个商业案例的分析
3星|《冷启动》:营销案例集锦,跟冷启动关系牵强
3星|《重塑线下价值》:刘润的两篇商业访谈
2.5星|《AI进化论》:疑似基于PPT与公关稿整理汇编而成
3星|《原油阳谋论》:原油价格走势简史,原油期货操作入门
2星|《内容电商》:作者没有实际经验,说的是软文硬广卖货,跟知识付费无关
2星|《新媒体运营》:作者没有实际运营经验
《创新者的窘境》作者关于人生意义与子女教育的思考:4星|《你要如何衡量你的人生》
3星|《玩家1号》:《头号玩家》原著小说,美国80年代流行文化集大成
3星|《时间的玫瑰》:巴菲特信徒、价值投资者的笔记,看好茅台和腾讯
Copyright © 2011-2022 走看看