| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 855 人关注过本帖, 1 人收藏
标题:怎样才能在输完一行数据时动态增加一行呢?
只看楼主 加入收藏
unix
Rank: 1
等 级:新手上路
帖 子:134
专家分:0
注 册:2005-12-28
收藏(1)
 问题点数:0 回复次数:7 
怎样才能在输完一行数据时动态增加一行呢?

<!--#include file="xh_conn.asp"-->

<%

dim lianluo

lianluo=session("lianluo")

%>

</head>

<body>

<table width="916" border="0" align="center" cellpadding="5" cellspacing="0">

<tr align="center" bgcolor="#006699">

<td width="936"><font color="#FFFFFF">工件信息录入</font></td>

</tr>

<tr align="center" valign="top">

<td><table width="904" height="73" border="1">

<tr>

<td width="140">聯絡號</td>

<td width="140">圖號</td>

<td width="70"></td>

<td width="70">材料</td>

<td width="70"></td>

<td width="70"></td>

<td width="70"></td>

<td width="70"></td>

<td width="70"></td>

<td width="70">備註</td>

</tr>

<tr>

<td><input name="lianluo" type="text" id="lianluo2" value="<%=lianluo%>" size="20"></td>

<td><input name="tuhao" type="text" id="tuhao" size="20"></td>

<td><input name="" type="text" id="" size="10"></td>

<td><input name="材料" type="text" id="材料" size="10"></td>

<td><input name="" type="text" id="" size="10"></td>

<td><input name="" type="text" id="" size="10"></td>

<td><input name="" type="text" id="" size="10"></td>

<td><input name="" type="text" id="" size="10"></td>

<td><input name="" type="text" id="" size="10"></td>

<td><input name="備註" type="text" id="備註" size="10"></td>

</tr>

</table> <input type="submit" name="Submit" value="确定提交">

&nbsp;&nbsp;&nbsp;

<input type="reset" name="Submit2" value="重新输入">

<input name="button" type="button" onClick="javascript:history.back();" value="后退"></td>

</tr>

</table>

</body>

</html>

现在只能输入一组(一行)数据,怎么样才能在输入完一行后动态增加一行呢?



[此贴子已经被作者于2006-2-13 8:42:48编辑过]

搜索更多相关主题的帖子: quot FONT Roman Times face 
2006-02-13 08:38
islet
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:89
帖 子:6548
专家分:0
注 册:2005-1-28
收藏
得分:0 
用javascript控制
2006-02-13 09:19
unix
Rank: 1
等 级:新手上路
帖 子:134
专家分:0
注 册:2005-12-28
收藏
得分:0 
以下是引用islet在2006-2-13 9:19:00的发言:
用javascript控制

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>工件信息录入</title>
</head>

<SCRIPT language="javascript" type="text/javascript"><!--

var qtyIndex = 0;

function addFile() {
var QTY = form1.qty.value;
if (QTY == "" || QTY <= 0)
{
QTY=1;
}
if (QTY > 0)
{
writetable(QTY);
}
else
{
writetable(1);
}
}

function writetable(tqty) {

document.write("<form name=form1 method=post action=gj_save.asp>");
document.write("<table width=500 border=0 align=center cellpadding=5 cellspacing=0>");
document.write("<tr align=center bgcolor=#006699> ");
document.write("<td colspan=2><font color=#FFFFFF>工件信息录入</font></td>");
document.write("</tr>");

while (qtyIndex < tqty)
{
document.write("<tr align=center> ");
document.write("<td colspan=2>" + (qtyIndex+1) + "</td><input type=hidden name=id_" + qtyIndex + " value=" + qtyIndex + ">");
document.write("</tr>");
document.write("<tr align=center bgcolor=#FFFFFF> ");
document.write("<td width=104 align=right>聯絡號:</td>");
document.write("<td width=374 align=left><input name=lianluo_" + qtyIndex + " type=text size=38></td>");
document.write("</tr>");
document.write("<tr>");
document.write("<td align=right>圖號:</td>");
document.write("<td><input name=tuhao_" + qtyIndex + " type=text></td>");
document.write("</tr>");
document.write("<tr> ");
document.write("<td align=right>套:</td>");
document.write("<td><input name=套_" + qtyIndex + " type=text></td>");
document.write("</tr>");
document.write("<tr>");
document.write("<td align=right>材料:</td>");
document.write("<td><input name=材料_" + qtyIndex + " type=text></td>");
document.write("</tr>");
document.write("<tr>");
document.write("<td align=right>厚:</td>");
document.write("<td><input name=厚_" + qtyIndex + " type=text></td>");
document.write("</tr>");
document.write("<tr>");
document.write("<td align=right>寬:</td>");
document.write("<td><input name=寬_" + qtyIndex + " type=text></td>");
document.write("</tr>");
document.write("<tr>");
document.write("<td align=right>高:</td>");
document.write("<td><input name=高_" + qtyIndex + " type=text></td>");
document.write("</tr>");
document.write("<tr>");
document.write("<td align=right>鍍:</td>");
document.write("<td><input name=鍍_" + qtyIndex + " type=text></td>");
document.write("</tr>");
document.write("<tr>");
document.write("<td align=right>熱:</td>");
document.write("<td><input name=熱_" + qtyIndex + " type=text></td>");
document.write("</tr>");
document.write("<tr>");
document.write("<td align=right>備註:</td>");
document.write("<td><input name=備註_" + qtyIndex + " type=text></td>");
document.write("</tr>");

qtyIndex+=1;
}

document.write("<tr align=center valign=top> ");
document.write("<td colspan=2><input type=submit name=Submit value=确定提交> &nbsp;&nbsp;&nbsp; ");
document.write("<input type=reset name=Submit2 value=重新输入></td>");
document.write("</tr>");
document.write("</table>");
document.write("</form>");
}

//-->
</SCRIPT>

<body>
<form name="form1">

<table width=500 border=0 align=center cellpadding=5 cellspacing=0>
<tr align=center>
<td colspan=2><input type="text" name="qty" value=""><INPUT type=button onclick="addFile()" value=确定 id=btnAdd /></td>
</tr>
<tr align=center bgcolor=#006699>
<td colspan=2><font color=#FFFFFF>工件信息录入</font></td>
</tr>
<tr align=center>
<td colspan=2>1</td><input type=hidden name=id_0 value=0>
</tr>
<tr align=center bgcolor=#FFFFFF>
<td width=104 align=right>聯絡號:</td>
<td width=374 align=left><input name=lianluo_0 type=text size=38></td>
</tr>
<tr>
<td align=right>圖號:</td>
<td><input name=tuhao_0 type=text></td>
</tr>
<tr>
<td align=right>套:</td>
<td><input name=套_0 type=text></td>
</tr>
<tr>
<td align=right>材料:</td>
<td><input name=材料_0 type=text></td>
</tr>
<tr>
<td align=right>厚:</td>
<td><input name=厚_0 type=text></td>
</tr>
<tr>
<td align=right>寬:</td>
<td><input name=寬_0 type=text></td>
</tr>
<tr>
<td align=right>高:</td>
<td><input name=高_0 type=text></td>
</tr>
<tr>
<td align=right>鍍:</td>
<td><input name=鍍_0 type=text></td>
</tr>
<tr>
<td align=right>熱:</td>
<td><input name=熱_0 type=text></td>
</tr>
<tr>
<td align=right>備註:</td>
<td><input name=備註_0 type=text></td>
</tr>
<tr align=center valign=top>
<td colspan=2><input type=submit name=Submit value=确定提交> &nbsp;&nbsp;&nbsp; <input type=reset name=Submit2 value=重新输入></td>
</tr>
</table>
</form>
</body>
</html>

只能实现这样了。可不可以在输入一行时动态增加一行呢?
谢谢

[此贴子已经被作者于2006-2-13 9:27:04编辑过]

2006-02-13 09:26
阳光白雪
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:39
帖 子:2220
专家分:0
注 册:2005-11-18
收藏
得分:0 

<HTML>
<HEAD><TITLE>上传文件</TITLE>
<SCRIPT language=javascript type=text/javascript>
<!--
var RES_BT_DELETE = "删除";
var isIE = (navigator.userAgent.indexOf("MSIE") != -1);
var fileIndex = 0;

function addFile() {
var spanId = "filespan";
var fileId = "uploadfile" + (fileIndex++);
addInputFile(spanId, fileId);
}

function addInputFile(spanId, fileId) {
var span = document.getElementById(spanId);
if (span != null) {
var divObj = document.createElement("div"), fileObj, delObj;
divObj.id = fileId;
if (isIE) {
fileObj = document.createElement("<input type=file onchange=changeFile(form)>");
delObj = document.createElement("<input type=button onclick=delInputFile('" + spanId + "','" + fileId + "')>");
} else {
fileObj = document.createElement("input");
fileObj.type = "file";
fileObj.setAttribute("onchange", "changeFile(form)", 0);
delObj = document.createElement("input");
delObj.type = "button";
delObj.setAttribute("onclick", "delInputFile('" + spanId + "','" + fileId + "')", 0);
}
fileObj.name = fileId;
fileObj.size = "40";
fileObj.className = "input";
delObj.value = RES_BT_DELETE;
divObj.appendChild(fileObj);
divObj.appendChild(document.createTextNode(" "));
divObj.appendChild(delObj);
span.appendChild(divObj);
}
}

function delInputFile(spanId, fileId) {
var span = document.getElementById(spanId);
var divObj = document.getElementById(fileId);
if (span != null && divObj != null) {
span.removeChild(divObj);
}
}
//-->
</SCRIPT>
<META content="MSHTML 6.00.2800.1528" name=GENERATOR>
</HEAD>
<BODY class=pagebackground>
<FORM id=form action=XXX method=post encType=multipart/form-data>
<TABLE class=dialog1 height=20 cellSpacing=1 cellPadding=8 width="90%" align=center>
<TBODY>
<TR>
<TD noWrap>通过文件上传: </TD>
<TD id=filespan noWrap>
<INPUT class=input type=file size=40 name=file>
<INPUT id=btnAdd onclick=addFile() type=button value=添加>
</TD>
</TR>
</TBODY>
</TABLE>
</FORM>
</BODY></HTML>


专注于WEB前端交互平台开发:[url=http://blog./]blog.[/url](富客户端技术(RIA)交流平台)
2006-02-13 09:35
unix
Rank: 1
等 级:新手上路
帖 子:134
专家分:0
注 册:2005-12-28
收藏
得分:0 
以下是引用阳光白雪在2006-2-13 9:35:00的发言:

<HTML>
<HEAD><TITLE>上传文件</TITLE>
<SCRIPT language=javascript type=text/javascript>
<!--
var RES_BT_DELETE = "删除";
var isIE = (navigator.userAgent.indexOf("MSIE") != -1);
var fileIndex = 0;

function addFile() {
var spanId = "filespan";
var fileId = "uploadfile" + (fileIndex++);
addInputFile(spanId, fileId);
}

function addInputFile(spanId, fileId) {
var span = document.getElementById(spanId);
if (span != null) {
var divObj = document.createElement("div"), fileObj, delObj;
divObj.id = fileId;
if (isIE) {
fileObj = document.createElement("<input type=file onchange=changeFile(form)>");
delObj = document.createElement("<input type=button onclick=delInputFile('" + spanId + "','" + fileId + "')>");
} else {
fileObj = document.createElement("input");
fileObj.type = "file";
fileObj.setAttribute("onchange", "changeFile(form)", 0);
delObj = document.createElement("input");
delObj.type = "button";
delObj.setAttribute("onclick", "delInputFile('" + spanId + "','" + fileId + "')", 0);
}
fileObj.name = fileId;
fileObj.size = "40";
fileObj.className = "input";
delObj.value = RES_BT_DELETE;
divObj.appendChild(fileObj);
divObj.appendChild(document.createTextNode(" "));
divObj.appendChild(delObj);
span.appendChild(divObj);
}
}

function delInputFile(spanId, fileId) {
var span = document.getElementById(spanId);
var divObj = document.getElementById(fileId);
if (span != null && divObj != null) {
span.removeChild(divObj);
}
}
//-->
</SCRIPT>
<META content="MSHTML 6.00.2800.1528" name=GENERATOR>
</HEAD>
<BODY class=pagebackground>
<FORM id=form action=XXX method=post encType=multipart/form-data>
<TABLE class=dialog1 height=20 cellSpacing=1 cellPadding=8 width="90%" align=center>
<TBODY>
<TR>
<TD noWrap>通过文件上传: </TD>
<TD id=filespan noWrap>
<INPUT class=input type=file size=40 name=file>
<INPUT id=btnAdd onclick=addFile() type=button value=添加>
</TD>
</TR>
</TBODY>
</TABLE>
</FORM>
</BODY></HTML>

娃。。。哇。

谢谢。

大概就是这样的。可不可以做成动态增加,就像SQL里的一样,输入完一行自动增加一行,不要老点增加,因为数据可能有六百多行,这样点要点六百多次。。。那些女孩会直接OVER的

2006-02-13 09:38
stragewind
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2006-1-17
收藏
得分:0 
<HTML>
<HEAD><TITLE>上传文件</TITLE>
<SCRIPT language=javascript type=text/javascript>
<!--
var RES_BT_DELETE = "删除";
var isIE = (navigator.userAgent.indexOf("MSIE") != -1);
var fileIndex = 0;function addFile() {
var spanId = "filespan";
var fileId = "uploadfile" + (fileIndex++);
addInputFile(spanId, fileId);
}function addInputFile(spanId, fileId) {
var span = document.getElementById(spanId);
if (span != null) {
var divObj = document.createElement("div"), fileObj, delObj;
divObj.id = fileId;
if (isIE) {
fileObj = document.createElement("<input type=file onchange=changeFile(form)>");
delObj = document.createElement("<input type=button onclick=delInputFile('" + spanId + "','" + fileId + "')>");
} else {
fileObj = document.createElement("input");
fileObj.type = "file";
fileObj.setAttribute("onchange", "changeFile(form)", 0);
delObj = document.createElement("input");
delObj.type = "button";
delObj.setAttribute("onclick", "delInputFile('" + spanId + "','" + fileId + "')", 0);
}
fileObj.name = fileId;
fileObj.size = "40";
fileObj.className = "input";
delObj.value = RES_BT_DELETE;
divObj.appendChild(fileObj);
divObj.appendChild(document.createTextNode(" "));
divObj.appendChild(delObj);
span.appendChild(divObj);
}
}function delInputFile(spanId, fileId) {
var span = document.getElementById(spanId);
var divObj = document.getElementById(fileId);
if (span != null && divObj != null) {
span.removeChild(divObj);
}
}
//-->
</SCRIPT>
<META content="MSHTML 6.00.2800.1528" name=GENERATOR>
</HEAD>
<BODY class=pagebackground onkeydown="quickadd(event)">
<FORM id=form action=XXX method=post encType=multipart/form-data onsubmit="return checkCnt();">
<TABLE class=dialog1 height=20 cellSpacing=1 cellPadding=8 width="90%" align=center>
<TBODY>
<TR>
<TD noWrap>通过文件上传: </TD>
<TD id=filespan noWrap>
<INPUT class=input type=file size=40 name=file>
<INPUT id=btnAdd onclick=addFile() type=button value=添加>
</TD>
</TR>
</TBODY>
</TABLE>
</FORM>
</BODY></HTML>
<script language="JavaScript">
cnt = 0;
function checkCnt(){
document.FORM.Submit.disabled=true;
cnt++;
if (cnt!=1){
alert('正在提交数据. Please Wait');
return false;
}
}
function quickadd(event)
{
if((event.ctrlKey && event.keyCode == 13)||(event.altKey && event.keyCode == 83))
{
if (cnt==0){
this.addFile();
}else{
alert('正在提交数据. Please Wait');
}
}
}
</script>

2006-02-13 11:32
unix
Rank: 1
等 级:新手上路
帖 子:134
专家分:0
注 册:2005-12-28
收藏
得分:0 

<!--#include file="xh_conn.asp"-->

<%
dim lianluo
lianluo=session("lianluo")

%>


</head>

<body>
<table width="916" border="0" align="center" cellpadding="5" cellspacing="0">
<tr align="center" bgcolor="#006699">
<td width="936"><font color="#FFFFFF">工件信息录入</font></td>
</tr>
<tr align="center" valign="top">
<td><table width="904" height="73" border="1">
<tr>
<td width="140">聯絡號</td>
<td width="140">圖號</td>
<td width="70">套</td>
<td width="70">材料</td>
<td width="70">厚</td>
<td width="70">寬</td>
<td width="70">高</td>
<td width="70">鍍</td>
<td width="70">熱</td>
<td width="70">備註</td>
</tr>
<tr>
<td><input name="lianluo" type="text" id="lianluo2" value="<%=lianluo%>" size="20"></td>
<td><input name="tuhao" type="text" id="tuhao" size="20"></td>
<td><input name="&Igrave;&times;" type="text" id="&Igrave;&times;" size="10"></td>
<td><input name="材料" type="text" id="材料" size="10"></td>
<td><input name="厚" type="text" id="厚" size="10"></td>
<td><input name="寬" type="text" id="寬" size="10"></td>
<td><input name="高" type="text" id="高" size="10"></td>
<td><input name="鍍" type="text" id="鍍" size="10"></td>
<td><input name="熱" type="text" id="熱" size="10"></td>
<td><input name="備註" type="text" id="備註" size="10"></td>
</tr>
</table> <input type="submit" name="Submit" value="确定提交">
&nbsp;&nbsp;
<input type="reset" name="Submit2" value="重新输入">
&nbsp;
<input name="button" type="button" onClick="javascript:history.back();" value="后退"></td>
</tr>
</table>
</body>
</html>

2006-02-13 11:51
阳光白雪
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:39
帖 子:2220
专家分:0
注 册:2005-11-18
收藏
得分:0 

自己去慢慢修改吧,谁会有那么多的时间为你写代码~~~~


专注于WEB前端交互平台开发:[url=http://blog./]blog.[/url](富客户端技术(RIA)交流平台)
2006-02-13 12:32
快速回复:怎样才能在输完一行数据时动态增加一行呢?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.038458 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved