分解一下你的问题:
1、TEXT1的onblur事件,将TEXT1所在的form提交(formName.submit());
2、数据库处理(略),返回TEXT1、TEXT2、TEXT3应该有的值;
3、TEXT1、TEXT2、TEXT3 值的回写;如果是JSP,<input name=text1 value=<%=resultSet.get(略)%>>
1、TEXT1的onblur事件,将TEXT1所在的form提交(formName.submit());
2、数据库处理(略),返回TEXT1、TEXT2、TEXT3应该有的值;
3、TEXT1、TEXT2、TEXT3 值的回写;如果是JSP,<input name=text1 value=<%=resultSet.get(略)%>>
<script src="" language="javascript" id="pro"></script>1,onBlur --> document.getElementById('pro').src='xxx.asp?val='+this.value;而在xxx.asp可以根据传过来的val值进行查询.输出js代码
2,在当前页面显示刚才输出的js代码
我对这个JAVASCRIPT不懂的!
---------------------------------------------
<script src="" id="sub" language="javascript"></script>
<form name="form1">
<input type="text" name="text1" onBlur="document.getElementById('sub').src='index.asp?id='+this.value">
<br>
<input type="text" name="text2" id="text2">
</form>
index.asp
------------------------------
<%
response.write("document.form1.text2.value='从index.asp中得到的值:"+request("id")+"';")
%>
<!--
function getCount() {
var rs = new ActiveXObject("ADODB.Recordset");
var url = window.document.location.toString();
url = url.substr(url,url.lastIndexOf("/")) + "/GetData.asp?Text1=" + escape(document.getElementById("Text1").value);
rs.Open(url);
if (!rs.EOF) {
document.getElementById("Text2").value = rs("Text2");
document.getElementById("Text3").value = rs("Text3");
}
}//-->
</SCRIPT>
<!--GetData.asp-->
<%@ Language=VBScript %>
<!-- #Include file="inc/ADOVBS.INC" -->
<%
dim rec
dim conn'数据库连接 set rec = Server.CreateObject("Adodb.Recordset")
set conn = Server.CreateObject("Adodb.Connection")
dim strSQL conn.open "<连接串>"
strSQL = "select Text2,Text3 from TableName where Text1 = ' & Request.QueryString("Text1") & '"
rec.CursorLocation = 3
rec.Open strSQL,conn
Response.ContentType = "text/xml"
Response.Write "<?xml version='1.0' ?>" & vbCrLf
rec.Save Response,1
set rec = nothing
set conn = nothing
Response.End
%>
function getTotal()
{
var oBao = new ActiveXObject("Microsoft.XMLHTTP");
oBao.open("POST","check.asp?typeid="+document.all.typeid.value,false);
oBao.send();
document.all.maxtype.value=(oBao.responseText);
}
</script>
<input type=text name="typeid">
<input type=text name="maxtype">
<input type=button onclick="getTotal()">
check.asp<!--#include file="conn.asp"-->
<%
Dim typeid
typeid = Request.QueryString("typeid")
set rs = Server.CreateObject("ADODB.Recordset")
sql="SELECT maxtype from maxtype where id="&typeid
rs.open sql,conn,1,1
do while not rs.eof
If IsNull(rs("maxtype")) Then
Response.Write "0"
End If
Response.Write rs("maxtype")
rs.movenext
loop
rs.close
set rs = nothing
conn.close
set conn = nothing
%>conn.asp<%
dim conn
dim connstr
on error resume next
connstr="DBQ="+server.MapPath("data.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.CreateObject("ADODB.CONNECTION")
conn.open connstr
%>data.mdb数据库
maxtype表,
有id,maxtype字段.
因为,中文的原因...
以下可以解决.<script language="vbscript">
Function bytes2BSTR(vIn)
Dim strReturn,i,ThisCharCode,innerCode,Hight8,Low8,NextCharCode
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bytes2BSTR = strReturn
End Function
</script>
<script>
function getTotal()
{
var oBao = new ActiveXObject("Microsoft.XMLHTTP");
oBao.open("POST","check.asp?typeid="+document.all.typeid.value,false);
oBao.send();
document.all.maxtype.value=bytes2BSTR(baoHttp.responseBody);
}
</script>
<input type=text name="typeid">
<input type=text name="maxtype">
<input type=button onclick="getTotal()">
http://jkisjk.vip.sina.com/html/getDataFromServer.htm