Since I can't use coldfusion "autosuggest" with Railo, I need help in getting this to work with bootstrap typeahead and any help is appreciated!
The following is example code that works but is not dynamic. I need to integrate the query below.
------------------
<input
type="text"
class="span4 basicTypeahead"
placeholder="What's your favorite US State?"
autocomplete="off"
data-provide="typeahead"
/>
Open in new window
How can I get the results of a cfquery to populate the bootstrap typeahead? Code examples appreciated!
<script type="text/javascript">
var dataset = ['Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'District of Columbia', 'Florida'];
$(function(){
$(".basicTypeahead").typeahead({
source: dataset
,items: 10
});
});
</script>
Open in new window
My query
<cfquery datasource="myds" name="data">
SELECT ID
FROM res
WHERE Trim(ID) LIKE Trim('#ARGUMENTS.search#%'
)
ORDER BY ID
</cfquery>