DropDownList调用javascript控制表格行tr的显示与隐藏
DropDownList调用javascript控制表格行tr的显示与隐藏
<mce:script language="javascript"><!--
function cao() {
if(document.all.ddl_class.value=="0")
{
hongtou.style.display="none";
wailai.style.display="none";
wailai1.style.display="none";
}
else if(document.all.ddl_class.value=="1")
{
hongtou.style.display="block";
wailai.style.display="none";
wailai1.style.display="none";
}
else
{
hongtou.style.display="none";
wailai.style.display="block";
wailai1.style.display="block";
}
}
// --></mce:script>
<asp:DropDownList ID="ddl_class" runat="server" onchange="cao()">
<asp:ListItem Value="0">新建文件</asp:ListItem>
<asp:ListItem Value="1">红头文件</asp:ListItem>
<asp:ListItem Value="2">外来文件</asp:ListItem>
</asp:DropDownList>
<table>
<tr id="hongtou" style="DISPLAY:none" mce_style="DISPLAY:none">
<td>份数:</td>
<td></td>
</tr>
<tr id="wailai" style="DISPLAY:none" mce_style="DISPLAY:none">
<td>来文(电)单位:</td>
<td></td>
</tr>
<tr id="wailai1" style="DISPLAY:none" mce_style="DISPLAY:none">
<td>联系人:</td>
<td></td>
</tr>
</table>
相关文档:
page1.html为父窗口,page2.htm为子窗口。详细代码如下:
page1.html
引用
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Con ......
禁止选择
unselectable="on"(off): IE/Opera
style="-moz-user-select:none": FireFox(JS:element.style.MozUserSelect = "none";)
style="-khtml-user-select:none": Safari(JS:element.style.KhtmlUserSelect)
ons ......
String.prototype.changeQuery = function(name,value)
{
var reg = new RegExp("(^|)"+ name +"=([^&]*)(|$)");
var tmp = name + "=" + value;
if(this.match(reg) != null)
{
return this.replace(eval(reg),tmp);
}
else
{
if(this.match("[\?]"))
{
return this + ......
W3School是一个很好的初学者学习网站。下面的是里面的内容,主要是javascript对象的API说明与使用,希望在不懂的时候可以很方便地查看到所需要的疑问。
JavaScript String 对象参考手册
http://www.w3school.com.cn/js/jsref_obj_string.asp
JavaScript Date 对象参考手册
http://www.w3school.com.cn/js/jsref_obj_dat ......
<script language="javascript" type="text/javascript">
function arrayTest() {
//使用new Array()
var array1 = ......