在這裏,我得到阿賈克斯意見箱它的正常工作,但是當我給建議值,它不是自動提交手動我給enter鍵繼續怎樣給上改變提交RO此功能
這裏HTML如何讓onchange在此頁面上提交?
<form id="search" method="get" action="advanced_search_result.php">
<input type="text" size="20" name="keywords" value="" id="inputString" onkeyup="lookup(this.value);" onblur="fill();" autocomplete="off" style="height:30px; width:265px;" />
</form>
這裏腳本代碼
function lookup(inputString) {
if(inputString.length == 0) {
// Hide the suggestion box.
$('#suggestions').hide();
} else {
$.post("rpc.php", {queryString: ""+inputString+""}, function(data){
if(data.length >0) {
$('#suggestions').show();
$('#autoSuggestionsList').html(data);
}
});
}
} // lookup
function fill(thisValue) {
$('#inputString').val(thisValue);
setTimeout("$('#suggestions').hide();", 200);
}
嘗試在您的標記中添加'onchange ='javascript:document.getElementById(「search」)。submit();''。 –