这完全取决于您希望页面如何操作。您能更具体一点吗?
当您说“输入值”时,您的意思是一个文本框?
在下面的示例中,我假设您将有两个字段和一个提交按钮:
<form action=""> <label for="MyTextBox1>Enter some text:</label> <input type="text" id="MyTextBox1" /> <label for="MyTextBox1>Enter some text:</label> <input type="text" id="MyTextBox2" /> <input type="button" onclick="showCustomer();" /></form>
您的Javascript函数的定义将从
function showCustomer(str)
至
function showCustomer()
并且您需要删除所有关联的
str代码。
要获取这些值,请使用
document.getElementById:
var val1 = document.getElementById("MyTextBox1").value);var val2 = document.getElementById("MyTextBox1").value);xmlhttp.open("GET","getcustomer.asp?q="+ val1 +"&r=" + val2 ,true);这很粗糙而且已经准备好,但是是一个很好的起点。



