难题!用js的取值问题
leoiv 2004-09-17 02:09:48 我所要实现的是当我在一个text框里输入一个卡号时,按查询button.然后系统自动在excel表里查询到该记录,该记录是唯一的.然后在其他text框里显示记录的全部字段内容。谁能帮我解决一下.
要求: 不用asp.直接用js来完成..
代码如下:
<html>
<head><title>sdfs</title>
<script language="javascript">
function Pre()
{
xx=kh.kh1.value;
n1=select 客户卡号 from 基点汇总1 where 客户卡号=xx;
n2=select 客户名称 from 基点汇总1 where 客户卡号=xx;
n3=select 累计点数 from 基点汇总1 where 客户卡号=xx;
n4=select 未定义字段 from 基点汇总1 where 客户卡号=xx;
n5=select 累计消费 from 基点汇总1 where 客户卡号=xx;
document.h1.khkh.value=n1;
document.h2.khmc.value=n2;
document.h3.ljds.value=n3;
document.h4.bl1.value=n4;
document.h5.ljxf.value=n5;
}
</script>
</head>
<body>
<div id="Layer2" style="position:absolute; width:410px; height:181px; z-index:2; left: 571px; top: 173px;">
<table cellpadding=0 cellspacing=0 border=1 >
<tr><td colspan=2>您所要查询的记录为:</td></tr>
<tr>
<td>客户卡号: </td><td><form method="post" name="h1"><input type="text" name="khkh"></form></td>
</tr>
<tr>
<td>客户名称: </td><td><form method="post" name="h2"><input type="text" name="khmc"></form></td>
</tr>
<tr>
<td>累计点数: </td><td><form method="post" name="h3"><input type="text" name="ljds"></form></td>
</tr>
<tr>
<td>未定义字段: </td><td><form method="post" name="h4"><input type="text" name="bl1"></form></td>
</tr>
<tr>
<td>累计消费: </td><td><form method="post" name="h5"><input type="text" name="ljxf"></form></td>
</tr>
</table>
</div>
<div id="Layer1" style="position:absolute; width:232px; height:55px; z-index:1; left: 571px; top: 105px;">
<table cellpadding=0 cellspacing=0 border=1 >
<tr><td colspan=2>请输入要查询的卡号:</td></tr>
<tr><td colspan=2>
<form method="post" action="" name="kh">
<input type="text" name="kh1" maxlength="10">
<input type="button" name="kh2" value="查询" onclick=Pre()>
</form>
</td></tr>
</table>
</div>
</body>