网络编程
位置:首页>> 网络编程>> Asp编程>> ASP申请单动态添加实现方法及代码

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
投稿

猜你喜欢

  • 只添加了一些自己想到的常用的功能,欢迎大家补充添加自己的好的思路.    通用的正则和方法可以写在RegExpObj中,
  • 我一直使用Microsoft的FrontPage 98来开发ASP/ADO之类的Internet数据库应用程序。现在我听说许多人都非常信奉采
  • 在利用javascript内置的eval函数,将json格式的字符串转换成JS对象时,需要用一对"()"先将该字符串包住
  • 在进行CSS网页布局开发时,您肯定遇到过形形色色的布局问题,虽然有大量的教程提供帮助,但最后可能被搞得焦头烂额。本文的目的是让您的设计过程更
  • 你一定想下载一下感兴趣的网页,以便慢慢欣赏吧!利用FrontPage能够轻松做到这一点,甚至可以下载整个站点,当然这里只能下载静态的页面。启
  • WEB程序员的技能要求: Web程序员不光要对 后端程序(如 php,jsp,asp.net)语言知识,对程序设计架构知识,数据库
  •  <% pagenum=55'指定打印行数 %> <HTML> <HEAD> <
  • 内容摘要:MySQL易学易用,附带丰富的技术文档,这两个因素使之被广泛应用。然而,随着MySQL发展加快,即使一个MySQL老手有时也会为该
  • 使用MySQL的命令终端时,如果输入SQL有误,将有beep声。若要关闭该功能,根据mysql --help,使用mysql --no-be
  • MySQL安全性指南(2) 作 者: 晏子2.1.3 数据库和表权限下列权限运用于数据库和表上的操作。ALTER允许你使用ALTER TAB
  • 例如:文本abcaBcabCaBCabcaBCa,关键字bc,在不区分大小写的情况,一共有6个匹配项。 则在网页中显示的是abcaBcabC
  • 有时候,规划师(或需求、交互)把内容呈现的框架草图搭建好后,就直接“丢”给了设计师,让设计师在画好的框架里去美化内容,出来后的效果,往往达不
  • 当产品走到HTML Coding这块,多浏览器的测试是很重要,也很麻烦的一个环节。现在大家主要是保证IE6,7及Firefox的一致。bro
  • MyISAM 是MySQL中默认的存储引擎,一般来说不是有太多人关心这个东西。决定使用什么样的存储引擎是一个很tricky的事情,但是还是值
  • 最近要做数据库同步,如果网上找了例子,成功,记录下来,下回再看。这个是网上找的一编文章。以下配置在本机上已经成功:实现功能:A为主服务器,B
  • 如何显示随机信息?使用了asp的randomize来创造随机数,select case来显示自定义信息。具体代码如下:<html>
  • 网页制作中需要把握好很多原则和细节,今天我们来谈谈网页设计中的平衡、对比、连贯和留白。一、平衡如果你的页面是平衡的,当用户浏览这个页面的时候
  • 不论是做WEB设计还是做交互模型,最快确立创意与设计效果的最好办法就是用笔在纸上绘制出来。不过从事IT行业的人很少一部分是来自美术学院。当然
  • 不是很难哦,我们现在就可以实现VBScript在服务器端验证,就是下面的函数:<%FUNCTION TestString(S
  • 当然是可以的,而且非常简单,今天就教大家在ASP中不用模板生成HTML静态页的方法。这里假设有一个htmer.asp动态页面,你想把它生成为
手机版 网络编程 asp之家 www.aspxhome.com