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>
====================


猜你喜欢
- 最近开始学习Python编程,遇到scatter函数,感觉里面的参数不知道什么意思于是查资料,最后总结如下:1、scatter函数原型2、其
- 本文会介绍一些Python大神用的贼溜的技巧,让一探究竟吧!欢迎收藏学习,喜欢点赞支持,欢迎畅聊。整理字符串输入整理用户输入的问题在编程过程
- 本文实例讲述了PHP读取txt文本文件并分页显示的方法。分享给大家供大家参考。具体实现方法如下:<?php &n
- 首先 下载 jedis.jar包然后再 工程设置里面找到Libraries,点击+。添加下载好的jedis.jar包。点击OK退出即可创建J
- 本文实例为大家分享了基于TensorFlow的CNN实现Mnist手写数字识别的具体代码,供大家参考,具体内容如下一、CNN模型结构输入层:
- 一,索引的重要性索引用于快速找出在某个列中有一特定值的行。不使用索引,MySQL必须从第1条记录开始然后读完整个表直到找出相关的行。表越大,
- isnumeric()方法检查字符串是否仅由数字组成。这种方法只表示为Unicode对象。注意:要定义一个字符串为Unicode
- 一篇关于STR和UNICODE的好文章整理下python编码相关的内容注意: 以下讨论为Python2.x版本, Py3k的待尝试开始用py
- 今天在看框架的时候无意间看到了document.compatMode,经过一番资料查找,终于搞懂了。文档模式在开发中貌似很少用到,最常见的是
- 在 Python 中对一个可迭代对象进行排序是很常见的一个操作,一般会用到 sorted() 函数num_list = [4, 2, 8,
- 1.什么是MD5加密MD5消息摘要算法(MD5 Message-Digest Algorithm),一种被广泛使用的密码散列函数,可以产生出
- 以下内容都是针对Pytorch 1.0-1.1介绍。很多文章都是从Dataset等对象自下往上进行介绍,但是对于初学者而言,其实这并不好理解
- sys模块提供了与python解释器紧密相关的一些变量和函数。sys部分常用函数函数说明path获取模块文件搜索路径的字符串,或临时指定新搜
- 目录一、Go调用C代码的原理二、在Go中使用C语言的类型1、原生类型数值类型指针类型字符串类型数组类型2、自定义类型枚举(enum)结构体(
- 什么是Inception ResnetV2Inception ResnetV2是Inception ResnetV1的一个加强版,两者的结构
- 一、下载地址Apache 5.4 —— httpd-2.4.4-win32.zipPHP 5.4 —— php-5.4.15-Win32-V
- 前言: 在各类技术岗位面试中,似乎 MySQL 相关问题经常被问到。无论你面试开发岗位或运维岗位,总会问几道数据库问题。经常有小伙
- 在pandas中,经常对数据进行处理 而导致数据索引顺序混乱,从而影响数据读取、插入等。小笔总结了以下几种重置索引的方法:import pa
- glob模块实例详解glob的应用场景是要寻找一系列(符合特定规则)文件名。glob模块是最简单的模块之一,内容非常少。用它可以查找符合特定
- php获取文件创建时间、修改时间常用代码filemtime ( string filename )返回文件上次被修改的时间,出错时返回 FA