0

如何在代码底部的第二个函数中将名字输入附加到 searchA.php?我需要在不刷新页面的情况下执行此操作。

<form action='' method='post'>
<tr><td>Customer Last Name</td><td><input type="edit" name="Customer_Name__2b" value="" size="20" class='auto'></td></tr>
<tr><td>Customer First Name</td><td><input type="edit" name="Customer_Name__2" value="" size="20" class='auto2'></td></tr>
<tr><td>Address</td><td><input type="edit" name="Address__3" value="" size="20" class="autoA" ></td></tr>
<form/>

<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.1/jquery-ui.min.js"></script>    
<script type="text/javascript">
$(function() {

    //autocomplete
    $(".auto").autocomplete({
        source: "search.php",
        minLength: 1
    }); 



});

</script>

 <script type="text/javascript">
$(function() {

    //autocomplete
    $(".auto2").autocomplete({
        source: "searchF.php?fname=",  //how to auto populate a get parameter?
        minLength: 1
    });             

});
</script> 

</html>
4

1 回答 1

0

您可以通过执行来检索表单值$("input[name='Customer_Name__2']").val(),因此您可以将相关行修改为如下所示:

source: "searchF.php?fname="+escape($("input[name='Customer_Name__2']").val()),
于 2013-10-16T06:12:59.857 回答