<!--#include file='sel.asp'-->
直接这样写不行吗
直接这样写不行吗
解决方案 »
- js 播放音乐的问题
- 网上的JS复制到本地就无效............
- js里面怎么表示用utf-8
- 菜鸟问题,进来看看,在线等候,先谢谢了。
- 如何用window.open打开一个“\\192.168.0.99\abcd”这样的目录?
- 自己定义一个类,类有自己的方法,然后生成这个类的实例,把这个实例给数组,然后取出数组元素,这个元素就没有这个实例的方法了!顶者有
- 再问传递值到Option中如何解决,补充,请大家看
- <input 数组,事件中如果判断是第几个?
- 怎么分割?
- JQUERY 2个页签,如何默认加载第二个页签的内容?谢谢。
- 怎么右键点击 .net web form的datagrid弹出菜单?解决后再放100分,顶着有分
- 关于datagrid隐藏问题
页面加载的时候初始化一行,如果不需要就把它隐藏,然后clone这一行就可以了
<html>
<head>
<title>code by meixx</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
var curRow=null;
function selectRow(tr1){
if(curRow)
curRow.bgColor="#FFFFFF";
tr1.bgColor="e7e7e7";
curRow=tr1;
}
function addRow(src){
var newrow = src.insertRow(src.rows.length-1);
newrow.attachEvent("onclick",function(){selectRow(newrow);});
newrow.height=20;
var i=4;
while(i--){
var newcell = newrow.insertCell();
switch(i){
case 0: newcell.innerHTML= '<input type="button" onClick="javascript:delRow(this.parentElement.parentElement)" value="删除此行">';break;
default: newcell.innerHTML=div1.innerHTML;break;
}
}
}
function delRow(src){
src.parentElement.deleteRow(src.rowIndex);
}
</script>
</head><body>
<table id="tb" width="100%" border="1" align="center" cellpadding="1" cellspacing="1" style="border-collapse:collapse" bordercolor="#111111">
<tr>
<th scope="col" width="25%">一</th>
<th scope="col" width="25%">二</th>
<th scope="col" width="25%">三</th>
<th scope="col" width="25%">四</th>
</tr>
<tr id="blankRow" onClick="addRow(this.parentElement)">
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<div id="div1" style="display:none "><select id="txt" style="width:97%; background-color:#FFFFEF"><option>test</option></select></div>
</body>
</html>
就像用这种方法
:(
'dim count
set rst=Server.CreateObject("ADODB.Recordset")
rst.open "select pdid,tblprodeailinfo.pid,pdno,pdmemo,tblprodeailinfo.opid,tblprodeailinfo.optime,tblprojectinfo.proname,prono from tblprodeailinfo left join tblprojectinfo on tblprojectinfo.pid=tblprodeailinfo.pid",con,1,1
%>
<script language="JavaScript">
<!--
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rst.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rst("pdno"))%>","<%=trim(rst("pid"))%>","<%= trim(rst("pdid"))%>","<%=trim(rst("proname"))%>","<%=trim(rst("prono"))%>","<%=trim(rst("optime"))%>");
<%
count = count + 1
rst.movenext
loop
rst.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
alert("eeeeeeeeeeeeee");
//取得选择的公司id
alert(locationid)
ucompid="";
cid=document.form1.anclassid.options[document.form1.anclassid.selectedIndex].value.replace(/(^\s*)|(\s*$)/ig,"");
document.form1.selcompid.value=cid
if (cid==""){ return false; } // alert (cid)
document.form1.Nclassid.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
// alert (onecount) if (subcat[i][1] == locationid)
{
newOption1=new Option(subcat[i][0], subcat[i][2])
document.all.Nclassid.add(newOption1)
}
if (subcat[i][1] == cid)
{
//alert ("ok2");
document.form1.seldeptid.value="";
}
}
}
-->
</script><%'Dim sqlText,sqlText1%>
<TABLE style="TABLE-LAYOUT: fixed" width=230 cellSpacing=0 cellPadding=0 border=0 height=23> <tr bgcolor="#FFFFFF">
<%'Dim tempValue
sqlText="select pid,prono,proname from tblprojectinfo "
'Response.Write sqltext
%>
<TD id=oINNER bgColor=#f7f8f9 valign=top> <input type="hidden" id="selcompid" name="selcompid" size=2 value="<%if len(ucompid)>0 then Response.Write ucompid else Response.Write "" end if%>">
<select name="anclassid" size="1" id="anclassid" onChange="alert('en');changelocation(document.form1.anclassid.options[document.form1.anclassid.selectedIndex].value)" style="border:0px solid #000000; FONT-FAMILY: 宋体; FONT-SIZE: 9pt;color:#000000; background-color:#ffffff" >
<% rst.open sqlText,con,1,1
If Not (rst.eof And rst.bof) Then
tempValue=rst("pid")
While Not rst.eof
%>
<option value="<%=trim(rst("pid"))%>" ><%=trim(rst("proname"))%></option>
<%
rst.movenext
Wend
End If
rst.close
%>
</select>
<%
sqlText="select pdid,pid,pdno from tblprodeailinfo"
sqlText=sqlText+" Where pid='" & tempValue & "'"
'Response.Write sqltext%>
<TD id=oINNER bgColor=#f7f8f9 valign=top> <input type="hidden" id="seldeptid" size=2 name="seldeptid" value="<%if len(udeptid)>0 then Response.Write udeptid else Response.Write "" end if%>">
<select name="Nclassid" onchange="seldept();" style="border:0px solid #000000; FONT-FAMILY: 宋体; FONT-SIZE: 9pt;color:#000000; background-color:#ffffff" >
<%
rst.open sqlText,con,1,1
' Response.Write udeptid & ","& rst("deptid") &"<br>"
If Not (rst.eof And rst.eof) Then
while not rst.eof
%>
<option value="<%=trim(rst("pdid"))%>" <%if cstr(ufluxid)=cstr(trim(rst("pid"))) then Response.Write "selected" end if%>><%=trim(rst("pdno"))%></option>
<%rst.movenext
wend
End If
rst.close
set rst=nothing
%>
</select>
</TR>
</table>