ASP 动态生成的文本框,如何在不提交表单的情况下将文本框中的内容存入SESSION中,或如何得得准确的文本框
<formname="form1"method="post"><tr><tdwidth="20%"align="right"height="30">选择产品:</td><...
<form name="form1" method="post">
<tr>
<td width="20%" align="right" height="30">选择产品:</td>
<td width="80%" class="category">
<table cellpadding="0" cellspacing="0" width="100%" border=0>
<%for x=1 to maxproduit%>
<tr id="cailiaohan<%=x%>"<%if x<>1 then%> style="display:none;"<%end if%>>
<td>
<input name="huiyuan2<%=x%>" type="text" style="width:150px " onClick="JavaScript:window.open('../huiyuan/huiyuan1.asp?form=form1&field=huiyuan<%=x%>&field2=huiyuan2<%=x%>&field3=huiyuan3<%=x%>','','directorys=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=853,height=470,top=176,left=161');">
<span id="heji"><span class="STYLE1">
<input name="huiyuan3<%=x%>" type="text" style="width:150px" />
</span></span>
<input type="hidden" name="huiyuan<%=x%>">
<input name="huohao<%=x%>" readonly onClick="JavaScript:window.open('produit2.asp?form=form1&field=huohao<%=x%>&field2=price<%=x%>&field3=hidprice<%=x%>&span1=showshulian<%=x%>','','directorys=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=853,height=470,top=176,left=161');" style="width:80px" value="单击选择产品">
数量: <input type="text" name="shulian<%=x%>" style="width:30px" onKeyUp="value=value.replace(/[^\d.]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d.]/g,''))" value="1">
单价: <input type="text" name="price<%=x%>" style="width:50px" onKeyUp="value=value.replace(/[^\d.]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d.]/g,''))">
<input type="hidden" name="hidprice<%=x%>">
<%
if session("shiwei_id")=1 then
sql="select * from ku order by id"
set rs_ku=conn.execute(sql)
else
sql="select * from ku where instr(login,'"&session("shiwei_id")&",')>0 order by id"
set rs_ku=conn.execute(sql)
end if
if rs_ku.eof then
%>
<script language="javascript">
alert("没有属于你管理的仓库,请先添加仓库!")
window.location.href="../system/ku_add.asp"
</script>
<%
response.end
end if
%>
仓库: <select name="ku<%=x%>">
<%
do while rs_ku.eof=false
%>
<option value="<%=rs_ku("id")%>"<%if rs_ku("moren") then%> selected="selected"<%end if%>><%=rs_ku("ku")%></option>
<%
rs_ku.movenext
loop
%>
</select>
<%if x<>maxproduit then%><span onClick="cailiaohan<%=(x+1)%>.style.display=''" style="cursor:hand;">下一个产品</span><%end if%>
<%if x=1 then%><font color="#ff0000">*</font><%end if%>
<label></label>
<div id="showshulian<%=x%>"></div> </td>
</tr>
<%next%>
</table> </td>
不好意思,问题多了点,呵呵,序号动态生成的文本框如何得到其的文本框名称,后才可以将其内容存入SESSION 展开
<tr>
<td width="20%" align="right" height="30">选择产品:</td>
<td width="80%" class="category">
<table cellpadding="0" cellspacing="0" width="100%" border=0>
<%for x=1 to maxproduit%>
<tr id="cailiaohan<%=x%>"<%if x<>1 then%> style="display:none;"<%end if%>>
<td>
<input name="huiyuan2<%=x%>" type="text" style="width:150px " onClick="JavaScript:window.open('../huiyuan/huiyuan1.asp?form=form1&field=huiyuan<%=x%>&field2=huiyuan2<%=x%>&field3=huiyuan3<%=x%>','','directorys=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=853,height=470,top=176,left=161');">
<span id="heji"><span class="STYLE1">
<input name="huiyuan3<%=x%>" type="text" style="width:150px" />
</span></span>
<input type="hidden" name="huiyuan<%=x%>">
<input name="huohao<%=x%>" readonly onClick="JavaScript:window.open('produit2.asp?form=form1&field=huohao<%=x%>&field2=price<%=x%>&field3=hidprice<%=x%>&span1=showshulian<%=x%>','','directorys=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=853,height=470,top=176,left=161');" style="width:80px" value="单击选择产品">
数量: <input type="text" name="shulian<%=x%>" style="width:30px" onKeyUp="value=value.replace(/[^\d.]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d.]/g,''))" value="1">
单价: <input type="text" name="price<%=x%>" style="width:50px" onKeyUp="value=value.replace(/[^\d.]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d.]/g,''))">
<input type="hidden" name="hidprice<%=x%>">
<%
if session("shiwei_id")=1 then
sql="select * from ku order by id"
set rs_ku=conn.execute(sql)
else
sql="select * from ku where instr(login,'"&session("shiwei_id")&",')>0 order by id"
set rs_ku=conn.execute(sql)
end if
if rs_ku.eof then
%>
<script language="javascript">
alert("没有属于你管理的仓库,请先添加仓库!")
window.location.href="../system/ku_add.asp"
</script>
<%
response.end
end if
%>
仓库: <select name="ku<%=x%>">
<%
do while rs_ku.eof=false
%>
<option value="<%=rs_ku("id")%>"<%if rs_ku("moren") then%> selected="selected"<%end if%>><%=rs_ku("ku")%></option>
<%
rs_ku.movenext
loop
%>
</select>
<%if x<>maxproduit then%><span onClick="cailiaohan<%=(x+1)%>.style.display=''" style="cursor:hand;">下一个产品</span><%end if%>
<%if x=1 then%><font color="#ff0000">*</font><%end if%>
<label></label>
<div id="showshulian<%=x%>"></div> </td>
</tr>
<%next%>
</table> </td>
不好意思,问题多了点,呵呵,序号动态生成的文本框如何得到其的文本框名称,后才可以将其内容存入SESSION 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询