|
蓝森林 http://www.lslnet.com 2006年8月25日 8:28
[ASP]输入前两个表单内容后,自动搜索数据库获得第三个参数,如何实现?
我需要做一个定单输入系统:后台录入的时候,输入了产品和规格,就需要查询数据库,如果以前曾经卖过这个规格的产品给某公司,就直接在价格的那个表单里显示最近一次卖给他的价格,如何才能实现啊。
————————————————
问题详细解释和补充:
同一个表里,表 price 里面有字段: product size price 三个字段。
现在表里已经有200条数据,现在我要录入新的数据,通过表单。
我输入 product size 完了以后,该页就自动和数据库里的内容比较,如果已经有了数据,那就显示我录入的该产品的最近的一条的价格,并自动填到 price 这个表单里。
听朋友说需要先生成数组然后JS 判断,该页不能刷新。
提交页如下:
[html] <form action="add.asp" method="post" name="test">
<table border="1" width="611" cellspacing="0" cellpadding="0" style="border-collapse: collapse" height="164" bordercolor="#C0C0C0" id="table1">
<tr>
<td width="135" height="24" align="center">
<p align="center">产品名称</td>
<td width="238" height="24" align="center">
<p align="center">产品型号</td>
<td width="209" height="24" align="center">
产品价格</td>
</tr>
<tr>
<td width="135" height="37" align="center">
<input type="text" name="product1" size="12"></td>
<td width="238" height="37" align="center">
<input type="text" name="size1" size="12" onkeyup="jsAutoInstance.handleEvent(this.value,'mingcheng1',event)" id="mingcheng1"></td>
<td width="209" height="37" align="center">
<input type="text" name="price1" size="12" onkeyup="jsAutoInstance1.handleEvent(this.value,'guige1',event)" id="guige1"></td>
</tr>
<tr>
<td width="135" height="43" align="center">
<input type="text" name="product2" size="12"></td>
<td width="238" height="43" align="center">
<input type="text" name="size2" size="12"></td>
<td width="209" height="43" align="center">
<input type="text" name="price2" size="12"></td>
</tr>
<tr>
<td width="135" height="63" align="center">
</td>
<td width="238" height="63" align="center">
<input type="submit" value="提交" name="B1"></td>
<td width="209" height="63" align="center">
</td>
</tr>
</table></form>[/html] |
|