asp如何实现多行文本框的输入,多谢。 60
主界面<formaction="add.asp"method="POST">......<inputname="a1"type="text"id="a1"value="<...
主界面
<form action="add.asp" method="POST">
......
<input name="a1" type="text" id="a1" value="<%=rs("a1")%>" size="4">
</div></td>
</tr>
<%
rs.movenext
loop
set rs=nothing
%>
......
提交界面
add.asp:
<!--#include file="conn.asp"-->
<%
dim a1
for i=73 to 75 ' 如何循环,动态获取id号码
a1=request("a1")(i)
set rs=rsfun("update toubiaoRecord set a1="&a1&" where id="&i, 3)
next
Response.Redirect"table.asp"
%>
从而实现多行文本框的输入。谢谢高手了。 展开
<form action="add.asp" method="POST">
......
<input name="a1" type="text" id="a1" value="<%=rs("a1")%>" size="4">
</div></td>
</tr>
<%
rs.movenext
loop
set rs=nothing
%>
......
提交界面
add.asp:
<!--#include file="conn.asp"-->
<%
dim a1
for i=73 to 75 ' 如何循环,动态获取id号码
a1=request("a1")(i)
set rs=rsfun("update toubiaoRecord set a1="&a1&" where id="&i, 3)
next
Response.Redirect"table.asp"
%>
从而实现多行文本框的输入。谢谢高手了。 展开
展开全部
<%
for x=1 to 50 ‘一次最多添加50行
%>
<tr>
<td class="datagrid_title" align=center><%=x%></td>
<td class="datagrid_body" align="left">
<input type="hidden" name="buy_goods_id_<%=x%>">
<input type="hidden" name="goods_id_<%=x%>">
<input name="goods_code_<%=x%>" style="width:100%;" class="datagrid_input" onFocus="this.select();document.form_list.choose_no.value='<%=x%>';document.form_list.choose_field.value='goods_code_';if (document.form_list.istemp.value=='') {document.form_list.temp.value=this.value};document.form_list.istemp.value='';" onKeyDown="frm_down();" onDblClick="frm_choose('goods_code_','');" onBlur="datagrid_blur();"> </td>
<td class="datagrid_body" align="left">
<input name="goods_name_<%=x%>" style="width:100%;" class="datagrid_input" onFocus="this.select();document.form_list.choose_no.value='<%=x%>';document.form_list.choose_field.value='goods_name_';if (document.form_list.istemp.value=='') {document.form_list.temp.value=this.value};document.form_list.istemp.value='';" onKeyDown="frm_down();" onDblClick="frm_choose('goods_name_','');" onBlur="datagrid_blur();"> </td>
<td class="datagrid_body" align="left" <%if conn.execute("select field_show from field_bianhao where field_table='sell_back' and field_code='goods_spec1'")(0)=0 then%>style="display:none;"<%end if%>>
<input name="goods_spec1_<%=x%>" style="width:100%;" class="datagrid_input" onFocus="document.form_list.choose_no.value='<%=x%>';document.form_list.choose_field.value='goods_spec1_';" onKeyDown="frm_down();" maxlength="50" readonly tabindex="-1"> </td>
<td class="datagrid_body" align="left" <%if conn.execute("select field_show from field_bianhao where field_table='sell_back' and field_code='goods_spec2'")(0)=0 then%>style="display:none;"<%end if%>>
<input name="goods_spec2_<%=x%>" style="width:100%;" class="datagrid_input" onFocus="document.form_list.choose_no.value='<%=x%>';document.form_list.choose_field.value='goods_spec2_';" onKeyDown="frm_down();" maxlength="50" readonly tabindex="-1"> </td>
<td class="datagrid_body" align="left" <%if conn.execute("select field_show from field_bianhao where field_table='sell_back' and field_code='goods_spec3'")(0)=0 then%>style="display:none;"<%end if%>>
<input name="goods_spec3_<%=x%>" style="width:100%;" class="datagrid_input" onFocus="document.form_list.choose_no.value='<%=x%>';document.form_list.choose_field.value='goods_spec3_';" onKeyDown="frm_down();" maxlength="50" readonly tabindex="-1"> </td>
<td class="datagrid_body" align="left">
<input type="hidden" name="house_id_<%=x%>">
<input name="house_name_<%=x%>" style="width:100%;" class="datagrid_input" onFocus="this.select();document.form_list.choose_no.value='<%=x%>';document.form_list.choose_field.value='house_name_';datagrid_gethouse();if (document.form_list.istemp.value=='') {document.form_list.temp.value=this.value};document.form_list.istemp.value='';" onKeyDown="frm_down();" onDblClick="frm_choose('house_name_','');" onBlur="datagrid_blur();"> </td>
<td class="datagrid_body" align="left">
<input name="goods_pihao_<%=x%>" style="width:100%;" class="datagrid_input" onFocus="document.form_list.choose_no.value='<%=x%>';document.form_list.choose_field.value='goods_pihao_';" onKeyDown="frm_down();" maxlength="50" readonly tabindex="-1"> </td>
<td class="datagrid_body" align="left">
<span class="unit_span">
<select name="goods_unit_<%=x%>" class="unit_select" onFocus="document.form_list.choose_no.value='<%=x%>';document.form_list.choose_field.value='goods_unit_';" onKeyDown="frm_down();" onChange="datagrid_unit();">
<option value=""></option>
</select>
</span>
</td>
<td class="datagrid_body" align="left">
<input type="hidden" name="goods_number_old_<%=x%>">
<input name="goods_number_<%=x%>" style="width:100%;" class="datagrid_input" onFocus="this.select();document.form_list.choose_no.value='<%=x%>';document.form_list.choose_field.value='goods_number_';" onKeyDown="frm_down();" onBlur="datagrid_isnumber(this);datagrid_jisuan();"> </td>
<td class="datagrid_body" align="left">
<input type="hidden" name="goods_price_chengben_<%=x%>">
<input name="goods_price_<%=x%>" style="width:100%;" class="datagrid_input" onFocus="this.select();document.form_list.choose_no.value='<%=x%>';document.form_list.choose_field.value='goods_price_';" onKeyDown="frm_down();" onBlur="datagrid_isnumber(this);datagrid_jisuan();"> </td>
<td class="datagrid_body" align="left">
<input name="goods_money_<%=x%>" style="width:100%;" class="datagrid_input" onFocus="document.form_list.choose_no.value='<%=x%>';document.form_list.choose_field.value='goods_money_';" onKeyDown="frm_down();" readonly tabindex="-1"> </td>
<td class="datagrid_body" align="left" <%if conn.execute("select field_show from field_bianhao where field_table='sell_back' and field_code='goods_memo'")(0)=0 then%>style="display:none;"<%end if%>>
<input name="goods_memo_<%=x%>" style="width:100%;" class="datagrid_input" onFocus="this.select();document.form_list.choose_no.value='<%=x%>';document.form_list.choose_field.value='goods_memo_';" onKeyDown="frm_down();" maxlength="50"> </td>
</tr>
<%
next
%>
提交页面:
for x=1 to int(request.form("count"))
goods_id=request.form("goods_id_"&x)
if goods_id<>"" and goods_id<>"0" then
buy_goods_id=request.form("buy_goods_id_"&x)
goods_name=request.form("goods_name_"&x)
call check_id("goods",goods_id,"【第"&x&"行】商品【"&goods_name&"】不存在,请调整后继续!")
house_id=request.form("house_id_"&x)
house_name=request.form("house_name_"&x)
call check_id("house",house_id,"【第"&x&"行】仓库【"&house_name&"】不存在,请调整后继续!")
goods_number=cdbl(request.form("goods_number_"&x))
goods_price_chengben=cdbl(request.form("goods_price_chengben_"&x))
goods_money_chengben=goods_number*goods_price_chengben
sum_money_chengben=sum_money_chengben+goods_money_chengben
if action_handle="save" then
call check_number_ke(buy_goods_id,goods_number,"【第"&x&"行】商品【"&goods_name&"】可退数量不足,请调整后继续!")
end if
end if
next
在主界面增加一个影藏域:count
for x=1 to 50 ‘一次最多添加50行
%>
<tr>
<td class="datagrid_title" align=center><%=x%></td>
<td class="datagrid_body" align="left">
<input type="hidden" name="buy_goods_id_<%=x%>">
<input type="hidden" name="goods_id_<%=x%>">
<input name="goods_code_<%=x%>" style="width:100%;" class="datagrid_input" onFocus="this.select();document.form_list.choose_no.value='<%=x%>';document.form_list.choose_field.value='goods_code_';if (document.form_list.istemp.value=='') {document.form_list.temp.value=this.value};document.form_list.istemp.value='';" onKeyDown="frm_down();" onDblClick="frm_choose('goods_code_','');" onBlur="datagrid_blur();"> </td>
<td class="datagrid_body" align="left">
<input name="goods_name_<%=x%>" style="width:100%;" class="datagrid_input" onFocus="this.select();document.form_list.choose_no.value='<%=x%>';document.form_list.choose_field.value='goods_name_';if (document.form_list.istemp.value=='') {document.form_list.temp.value=this.value};document.form_list.istemp.value='';" onKeyDown="frm_down();" onDblClick="frm_choose('goods_name_','');" onBlur="datagrid_blur();"> </td>
<td class="datagrid_body" align="left" <%if conn.execute("select field_show from field_bianhao where field_table='sell_back' and field_code='goods_spec1'")(0)=0 then%>style="display:none;"<%end if%>>
<input name="goods_spec1_<%=x%>" style="width:100%;" class="datagrid_input" onFocus="document.form_list.choose_no.value='<%=x%>';document.form_list.choose_field.value='goods_spec1_';" onKeyDown="frm_down();" maxlength="50" readonly tabindex="-1"> </td>
<td class="datagrid_body" align="left" <%if conn.execute("select field_show from field_bianhao where field_table='sell_back' and field_code='goods_spec2'")(0)=0 then%>style="display:none;"<%end if%>>
<input name="goods_spec2_<%=x%>" style="width:100%;" class="datagrid_input" onFocus="document.form_list.choose_no.value='<%=x%>';document.form_list.choose_field.value='goods_spec2_';" onKeyDown="frm_down();" maxlength="50" readonly tabindex="-1"> </td>
<td class="datagrid_body" align="left" <%if conn.execute("select field_show from field_bianhao where field_table='sell_back' and field_code='goods_spec3'")(0)=0 then%>style="display:none;"<%end if%>>
<input name="goods_spec3_<%=x%>" style="width:100%;" class="datagrid_input" onFocus="document.form_list.choose_no.value='<%=x%>';document.form_list.choose_field.value='goods_spec3_';" onKeyDown="frm_down();" maxlength="50" readonly tabindex="-1"> </td>
<td class="datagrid_body" align="left">
<input type="hidden" name="house_id_<%=x%>">
<input name="house_name_<%=x%>" style="width:100%;" class="datagrid_input" onFocus="this.select();document.form_list.choose_no.value='<%=x%>';document.form_list.choose_field.value='house_name_';datagrid_gethouse();if (document.form_list.istemp.value=='') {document.form_list.temp.value=this.value};document.form_list.istemp.value='';" onKeyDown="frm_down();" onDblClick="frm_choose('house_name_','');" onBlur="datagrid_blur();"> </td>
<td class="datagrid_body" align="left">
<input name="goods_pihao_<%=x%>" style="width:100%;" class="datagrid_input" onFocus="document.form_list.choose_no.value='<%=x%>';document.form_list.choose_field.value='goods_pihao_';" onKeyDown="frm_down();" maxlength="50" readonly tabindex="-1"> </td>
<td class="datagrid_body" align="left">
<span class="unit_span">
<select name="goods_unit_<%=x%>" class="unit_select" onFocus="document.form_list.choose_no.value='<%=x%>';document.form_list.choose_field.value='goods_unit_';" onKeyDown="frm_down();" onChange="datagrid_unit();">
<option value=""></option>
</select>
</span>
</td>
<td class="datagrid_body" align="left">
<input type="hidden" name="goods_number_old_<%=x%>">
<input name="goods_number_<%=x%>" style="width:100%;" class="datagrid_input" onFocus="this.select();document.form_list.choose_no.value='<%=x%>';document.form_list.choose_field.value='goods_number_';" onKeyDown="frm_down();" onBlur="datagrid_isnumber(this);datagrid_jisuan();"> </td>
<td class="datagrid_body" align="left">
<input type="hidden" name="goods_price_chengben_<%=x%>">
<input name="goods_price_<%=x%>" style="width:100%;" class="datagrid_input" onFocus="this.select();document.form_list.choose_no.value='<%=x%>';document.form_list.choose_field.value='goods_price_';" onKeyDown="frm_down();" onBlur="datagrid_isnumber(this);datagrid_jisuan();"> </td>
<td class="datagrid_body" align="left">
<input name="goods_money_<%=x%>" style="width:100%;" class="datagrid_input" onFocus="document.form_list.choose_no.value='<%=x%>';document.form_list.choose_field.value='goods_money_';" onKeyDown="frm_down();" readonly tabindex="-1"> </td>
<td class="datagrid_body" align="left" <%if conn.execute("select field_show from field_bianhao where field_table='sell_back' and field_code='goods_memo'")(0)=0 then%>style="display:none;"<%end if%>>
<input name="goods_memo_<%=x%>" style="width:100%;" class="datagrid_input" onFocus="this.select();document.form_list.choose_no.value='<%=x%>';document.form_list.choose_field.value='goods_memo_';" onKeyDown="frm_down();" maxlength="50"> </td>
</tr>
<%
next
%>
提交页面:
for x=1 to int(request.form("count"))
goods_id=request.form("goods_id_"&x)
if goods_id<>"" and goods_id<>"0" then
buy_goods_id=request.form("buy_goods_id_"&x)
goods_name=request.form("goods_name_"&x)
call check_id("goods",goods_id,"【第"&x&"行】商品【"&goods_name&"】不存在,请调整后继续!")
house_id=request.form("house_id_"&x)
house_name=request.form("house_name_"&x)
call check_id("house",house_id,"【第"&x&"行】仓库【"&house_name&"】不存在,请调整后继续!")
goods_number=cdbl(request.form("goods_number_"&x))
goods_price_chengben=cdbl(request.form("goods_price_chengben_"&x))
goods_money_chengben=goods_number*goods_price_chengben
sum_money_chengben=sum_money_chengben+goods_money_chengben
if action_handle="save" then
call check_number_ke(buy_goods_id,goods_number,"【第"&x&"行】商品【"&goods_name&"】可退数量不足,请调整后继续!")
end if
end if
next
在主界面增加一个影藏域:count
展开全部
你这里有几个问题
1.set rs=rsfun("update toubiaoRecord set a1="&a1&" where id="&i, 3)
因为是字符型,要用单引号,所以要改成
set rs=rsfun("update toubiaoRecord set a1='"&a1&"' where id="&i, 3)
2.若用a1=request("a1")(i)这个的话,循环可以用for each来控制
提交文件应该这样写
dim a1
a1=trimrequest("a1")
aa=split(a1,",")
for i=0 to bound(aa)
set rs=rsfun("update toubiaoRecord set a1='"&aa(i)&"' where id="&i, 3)
next
1.set rs=rsfun("update toubiaoRecord set a1="&a1&" where id="&i, 3)
因为是字符型,要用单引号,所以要改成
set rs=rsfun("update toubiaoRecord set a1='"&a1&"' where id="&i, 3)
2.若用a1=request("a1")(i)这个的话,循环可以用for each来控制
提交文件应该这样写
dim a1
a1=trimrequest("a1")
aa=split(a1,",")
for i=0 to bound(aa)
set rs=rsfun("update toubiaoRecord set a1='"&aa(i)&"' where id="&i, 3)
next
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
首先你用要把记录查询出来,放在vb 变量里,接着在更新啊(更新时,使用循环更新就行。)
<%
'查询记录,申请数组,存放变量
'循环开始
更新(update tbl_no set a1=??? where id=数组a[1])
'循环结束
%>
<%
'查询记录,申请数组,存放变量
'循环开始
更新(update tbl_no set a1=??? where id=数组a[1])
'循环结束
%>
追问
拜托高手,可以具体写一下代码吗?我基础比较差,还是有点迷糊。
什么是vb 变量?数组又咋写?
追答
vb变量:
dim a;
vb数组:
看参考资料
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
textarea
或者采用js+table
或者采用js+table
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询