Copy link to clipboard
Copied
I have an autosuggest field that returns a country name which works fine.
<cfinput type="text"
name="country" message="You must enter your country of residence" validateat="onSubmit" required="yes" size="45" showAutoSuggestLoadingIcon="false"
autosuggest="cfc:ajaxlookup.getCountries({cfautosuggestvalue})">
I now want to retrieve the country ID from the country selected above and bind it to a hidden field.
Does anyone have a code example?
Copy link to clipboard
Copied
http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSd160b5fdf5100e8f-4439fdac128193edfd6-7f5e.html has a related example of this. Notice the <cfset ajaxOnLoad("init")> after the CFINPUT tag. That calls some JavaScript that calls a function to show the selected item. Your requirement is complex; it really needs to be given to a freelance coder if you want a bespoke solution coded.