ASP申请单动态添加实现方法及代码

作者:佚名 来源:中国IT实验室 时间:2008-11-04 11:09:00 



一个申请单可以包含N个项目,添加申请单时就需要动态加入代码了。

动态Table表格

<table border="0" width="98%" id="tabzx" name="tabzx" align="center"
class="table_list">
<tr>
<td class="th_list" width="10%">
A列
</td>
<td class="th_list" width="10%" align="center">
B列 </td>
<td class="th_list" width="10%" align="center">
C列
</td>
<td class="th_list" width="5%" align="center">
D列
</td>
<td class="th_list" width="5%" align="center">
E列
</td>
<td class="th_list" width="5%" align="center">
F列
</td><%--
<td class="th_list" width="7%" align="center">
G列
</td>

--%><td class="th_list" width="13%">
[
<a href="javascript:doSelect(450,400,'formEdit.supplyId')"><font
color="FF0000">选择设备</font> </a>]
</td>
</tr>
</table>



JS代码如下(根据条件弹出设备列表,然后选择已有设备)

function doSelect(Width,Height,ctrlobj){

var k;
var s = new Object();
k=showModalDialog("/Applications_add_addsearch.jsp",s,"dialogWidth:320px;status:no;scroll:no;dialogHeight:280px");
if (k!=null)
{
var url = "/applicationsAction.do?method=insertAddSeach&stId="+k[0]+"&sbId="+k[1]+"&ggId="+k[2];
window.open(url,'newwindow', 'height=600, width=800, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');
}

}

=========================

根据选择动态添加数据代码



<script language="vbscript">
dim lcountmx
lcountmx = 0
function badd(stid,stName,vcid,vcName,ggid,ggName,dwei,sliang,djia)
lcountmx=lcountmx+1
dim oRow,oCell,ii
set oRow=tabzx.insertRow
orow.id="trzx" & lcountmx
set ocell=orow.insertcell
dim sss
sss="<input type=hidden name=cgdjmx"& lcountmx & " value="""">"
sss=sss&"<input type=hidden name=stid"& lcountmx & " value=" & stid & ">"
sss=sss&"<input type=hidden name=stName"& lcountmx & " value=" & stName & ">"
sss=sss&"<input type=hidden name=vcid"& lcountmx & " value=" & vcid & ">"
sss=sss&"<input type=hidden name=ggid"& lcountmx & " value=" & ggid & ">"
sss=sss&stName
ocell.innerhtml= sss
ocell.classname="ListCellRow"


set ocell=orow.insertcell
ocell.classname="ListCellRow"
ocell.align="center"
ocell.width="60"
ocell.innerhtml="<input type=hidden name=vcName" & lcountmx & " value=" & vcName & ">"& vcName

set ocell=orow.insertcell
ocell.classname="ListCellRow"
ocell.align="center"
ocell.width="60"
ocell.innerhtml="<input type=hidden name=ggName" & lcountmx & " value=" & ggName & ">"& ggName

set ocell=orow.insertcell
ocell.classname="ListCellRow"
ocell.align="center"
ocell.width="60"
ocell.innerhtml="<input type=text size=10 name=thao" & lcountmx & " value=''>"

set ocell=orow.insertcell
ocell.classname="ListCellRow"
ocell.align="center"
ocell.width="60"
ocell.innerhtml="<input type=hidden name=dwei" & lcountmx & " value=" & dwei & ">"& dwei

set ocell=orow.insertcell
ocell.classname="ListCellRow"
ocell.align="center"
ocell.width="60"
ocell.innerhtml="<input type=text size=3 name=sliang" & lcountmx & " onchange='changeFun(" & lcountmx & ")' value=''>"
<%--
set ocell=orow.insertcell
ocell.classname="ListCellRow"
ocell.align="center"
ocell.width="60"
ocell.innerhtml="<input type=text size=3 name=djia" & lcountmx & " onchange='changeFun1(" & lcountmx & ")' value=''>"
--%>


set ocell=orow.insertcell
ocell.classname="ListCellRow"
ocell.innerhtml="<input type='button' value='删除' onClick='vbscript:bdel(" & lcountmx & ")' id=button7 name=button7>"
ocell.align="center"

document.applicationsForm.ypsl.value = lcountmx
end function

function bdel(l)
tabzx.deleteRow document.getElementById("trzx" & l).rowindex
end function

function changeFun(obj1)
change obj1
end function

function changeFun1(obj1)
change1 obj1
end function
</script>



====================

标签:
0
投稿

猜你喜欢

  • python opencv通过4坐标剪裁图片

    2022-06-03 20:14:03
  • webpack5的entry和output配置小白学习

    2024-04-30 09:52:08
  • Python二维码生成识别实例详解

    2021-06-10 19:59:22
  • Python使用pickle进行序列化和反序列化的示例代码

    2022-11-17 10:46:22
  • python可视化分析的实现(matplotlib、seaborn、ggplot2)

    2021-10-20 13:59:21
  • 详解小程序循环require之坑

    2024-02-24 03:38:29
  • Python进阶_关于命名空间与作用域(详解)

    2022-03-17 17:29:02
  • mysql 导入导出数据

    2011-02-23 12:27:00
  • vue 使用localstorage实现面包屑的操作

    2024-05-10 14:19:40
  • SqlServer将数据库中的表复制到另一个数据库

    2024-01-22 11:31:33
  • Persits AspJpeg 1.8+ 轻松实现透明文字去锯齿水印

    2009-03-20 14:03:00
  • asp 取一个数的整数 但不是四舍五入,只要有小数,就取大于这个数的整数

    2011-03-17 10:34:00
  • Python进阶之列表推导与生成器表达式详解

    2022-01-18 00:07:04
  • CentOS 7.2下MySQL的安装与相关配置

    2024-01-16 23:21:29
  • sqlserver 存储过程动态参数调用实现代码

    2011-10-24 19:41:22
  • 使用python实现excel的Vlookup功能

    2023-05-01 20:15:15
  • PyQt5-QDateEdit的简单使用操作

    2022-09-16 17:35:51
  • matplotlib教程——强大的python作图工具库

    2021-05-18 23:42:55
  • 如何计算多个订单的核销金额

    2024-01-26 17:56:31
  • Python字典推导式将cookie字符串转化为字典解析

    2023-02-26 14:22:17
  • asp之家 网络编程 m.aspxhome.com