Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Bind a hidden field with the results of a CFC autosuggest

Guest
Oct 30, 2013 Oct 30, 2013

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?

469
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 30, 2013 Oct 30, 2013
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources