如何将输入的字母从表单动态附加到查询中的变量...
代码如下......
<cfquery name="select" datasource="#xxxx#" dbtype="ODBC">
select xxxxx from yyyy where xxxxx like '%#form.search#%'
</cfquery>
<cfset head=#ValueList(MyQuery.pname,",")#>
<cfset head1=#listtoarray(head)#>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.8.3.js"></script>
<script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script>
$(function() {
var states = <cfoutput>#serializeJson(head1)#</cfoutput>;
$("#k").autocomplete({
source:states
});
});
</script>
<form action="/" method="get" id="searchForm">
<input type="text" name="search" id="search">
</form>
所以在这里我只想将“搜索”文本框值附加到查询('%#form.search#%'),只要我键入它而不重新加载页面或失去表单字段的焦点......
先感谢您... :)