我正在使用他的代码调用一个CFC,它通过AJAX返回自动提示结果。
<cfinput type="text" class="titleSearchField" name="TitleName" autosuggest="cfc:gz.cfcomp.search.AutoSuggestSearch({cfautosuggestvalue})">现在做什么只是生成一个自动建议列表。 点击其中一个自动生成的结果不会执行任何操作,但会将其保留在输入字段中。 点击时如何让搜索表单访问结果页面? 是否必须使用onClick属性并将结果传递给另一个查询以完整处理结果?
在下面的建议中,我添加了以下内容:
action="search.cfm?GameID=#AutoSuggestSearch.GameID#"但它引发了一个错误,即GameID未在AutoSuggestSearch中定义(尽管我从CFC查询中选择它)。
I'm using he following code the call a CFC which returns auto-suggest results through AJAX.
<cfinput type="text" class="titleSearchField" name="TitleName" autosuggest="cfc:gz.cfcomp.search.AutoSuggestSearch({cfautosuggestvalue})">What this does right now is only generate an Auto-suggest list. Clicking on one of the auto-generated results does nothing, but retain it in the input field. How do I make the search form visit a results page when clicked? Do I have to use the onClick attribute and pass the results for an additional query to full process the result?
At suggestion below I added the following:
action="search.cfm?GameID=#AutoSuggestSearch.GameID#"But it's throwing an error that GameID is not defined in AutoSuggestSearch (although I am selecting it from in the CFC query).
最满意答案
你有没有尝试在cfinput上使用onChange? 通过这种方式,当您选择该值时,您可以发出表单帖子(或另一个ajax请求)来执行搜索。
Did you try using onChange on the cfinput? That way when you select the value, you can fire off a form post (or another ajax request) to do a search.
更多推荐
results,search,CFC,电脑培训,计算机培训,IT培训"/> <meta name="descriptio
发布评论