日期:2014-05-18 浏览次数:20707 次
<td width="30%" style="padding: 5px;">请选择要借用的设备:</td>
<td width="70%">
<html:select property="deviceID" styleId="deviceID" onchange="select()">
<html:options collection="deviceList" property="deviceID" labelProperty="deviceName"/>
</html:select></td>
</tr>
<tr>
<td width="15%" style="padding: 5px;">库存数量:</td>
<td width="30%"><html:text property="kcsl" size="12" disabled="disabled"/></td>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Using Ajax for validation</title>
<script type="text/javascript">
var xmlHttp;
function createXMLHttpRequest() {
if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
}
function validate() {
createXMLHttpRequest();
var date = document.getElementById("birthDate");
var url = "ValidationServlet?birthDate=" + escape(date.value);
xmlHttp.open("GET", url, true);
xmlHttp.onreadystatechange = callback;
xmlHttp.send(null);
}
function callback() {
if (xmlHttp.readyState == 4) {
if (xmlHttp.status == 200) {
var mes = xmlHttp.responseXML.getElementsByTagName("message")[0].firstChild.data;