的範圍內amount..I要防止用戶進入量超過一定amount..I更大用ajax ..但它不工作的方式試着我想..我想jquery wud做需要..但我不擅長它..如果任何人都可以幫忙? Ajax的功能我寫了:jQuery來限制我有一個文本框,輸入需要輸入
function maxIssue(max, input, iid) {
var req = getXMLHTTP();
var strURL = "limit_input.php?max=" + max + "&iid=" + iid;
if (input > max) {
alert("Issue Failed.Quantity Present in Stock is " + max);
}
if (input < 0) {
alert("Issue Failed.Enter positive Value");
}
if (req) {
req.onreadystatechange = function() {
if (req.readyState == 4) {
// only if "OK"
if (req.status == 200) {
document.getElementById('maxdiv').innerHTML = req.responseText;
} else {
alert("There was a problem while using XMLHTTP:\n" + req.statusText);
}
}
}
}
req.open("GET", strURL, true);
req.send(null);
}
所以基本上,你試圖驗證訂單數量與實際庫存,對不對? –
是絕對... – Sharvari
然後,保健佳品我們什麼'limit_input.php'迴歸樣子?爲什麼你將'max'作爲輸入而不是輸出? –