在DIV里我用了表单form 的post向数据库提交数据后,服务器反馈回来一个xml文件,我想判断我在文本框里输入的值和我数据库里面的值来个判断,例如:判断输入的值是否在数据库里,显示出来。那我该如何判断呢?????
div中的代码<form method="post" action="findit.php">
<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
<label for="textinput2">
</label>
<input placeholder="" value="" type="text" />
</fieldset>
</div>
<a href="#page2"><input type="submit" value="开找" data-mini="true" />
</a>
</form>
<script type="text/javascript">
function createXmlHttpReq() {
if(window.XMLHttpRequest) {
xmlHttpReq = new XMLHttpRequest();
} else {
xmlHttpReq = new ActiveXObject("MSXML2.XMLHTTP");
}
return xmlHttpReq;
}
function processResponse()
{
if(xmlHttpReq.readyState == 4)
{
if(xmlHttpReq.status == 200)
{
/*var res = xmlHttpReq.responseText;
document.getElementById("message").innerHTML=res; */
var msg = xmlHttpReq.responseXML;
alert(xmlHttpReq.responseText);
}
}
}
function sendRequest(url) {
createXmlHttpReq();
xmlHttpReq.open("get",url,true);
xmlHttpReq.onreadystatechange=processResponse;
xmlHttpReq.send(null);
}
function doSubmit() {
var name = document.getElementById("lgname").value;
var pwd = document.getElementById("lgpwd").value;
var url = 'login_chk.php?name='+name+'&pwd='+ pwd;
sendRequest(url);
}
</script>
素胚勾勒不出你
当年话下
MMMHUHU
相关分类