Auto-suggest - I am stuck!
Okay, so here is my delima.
I have an auto-suggest drop down (a list of law firms). Once a law firm is selected from the auto-suggest, you click on the "ADD" button and the law firm name and is passed along to a text box. Once it is added to a txt box, the law firm name (along with the ID) needs to be saved back to the database.
I have got the auto-suggest part to work but I can't seem to add the chosen law firm name and ID, to the txt field, and then save it to the database.
Here is what I have so far. If you need further clarification, please let me know.
------------------------------------------------------------------------------------------------------------------------------------------
<cfquery name="GetOC" datasource="#datasourcename#">
SELECT * FROM table
WHERE CounselID NOT IN (SELECT CounselID FROM counseltable
WHERE IPlitID = #url.IPlitID#)
ORDER BY Counsel
</cfquery>
<script>
function lookupAjax(){
var oSuggest = $("#getOC")[0].autocompleter;
oSuggest.findValue();
return false;
}
$("#getOC").autocomplete("data/getOC.cfm", { autofill:true, extraParams:{iplitid:<cfoutput>#url.iplitid#</cfoutput>}, selectFirst:true,onFindValue:findValue,formatItem:formatItem,cellSeparator:"^" });
</script>
<!--- Autocomplete BEGIN --->
<label for="getOC">Autosuggest Opposing Counsel<br /><input type="text" id="getOC" value="" /></label><br style="clear:both;" />
<!--- Autocomplete END --->
My question is how do I pass along the law firm name and ID to a Text box and then take what is in the txt box (law firm name and ID) and save it back to the Database.
If you need more information, please ask.
Thank you,
Ashish Vohra
