如何在此页面上提交更改

how to give onchange submit on this page?

本文关键字:提交      更新时间:2023-09-26

这里我得到了ajax建议框,它运行良好,但当我给出建议值时,它不会自动手动提交。我输入了如何对此函数进行更改提交
此处html

<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);
    }

将此代码添加到要提交表单的任何位置。。在ajax完成或keyup e.code==13

$("#search").submit();