Expand my Community achievements bar.

SOLVED

Autocomplete Fields with AEM Forms

Avatar

Level 1

Hello everyone, I would like to create a form using AEM Forms that when the user enters their zip code automatically fills in the address fields.

Is there any way to do this natively or via API?

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

@luanh2511 

Suppose the list of address fields against zip codes is limited. In that case, you can write a servlet to list the addresses against codes as elaborated here[0] (a similar use case) and then make an AJAX call from the form to the servlet

OR,

if the data might change frequently, you can use FDM[1][2] to prefill data based on an input field.

Also, this can be done using an external API anyways.

 

[0] - https://experienceleague.adobe.com/docs/experience-manager-64/forms/customize-aem-forms/dynamically-... 

[1] - https://docs.mktossl.com/docs/experience-manager-learn/forms/prefill-fdm-db/configuring-form-data-mo...

[2] - https://experienceleague.adobe.com/docs/experience-manager-learn/forms/prefill-fdm-db/introduction.h... 

View solution in original post

2 Replies

Avatar

Correct answer by
Employee Advisor

@luanh2511 

Suppose the list of address fields against zip codes is limited. In that case, you can write a servlet to list the addresses against codes as elaborated here[0] (a similar use case) and then make an AJAX call from the form to the servlet

OR,

if the data might change frequently, you can use FDM[1][2] to prefill data based on an input field.

Also, this can be done using an external API anyways.

 

[0] - https://experienceleague.adobe.com/docs/experience-manager-64/forms/customize-aem-forms/dynamically-... 

[1] - https://docs.mktossl.com/docs/experience-manager-learn/forms/prefill-fdm-db/configuring-form-data-mo...

[2] - https://experienceleague.adobe.com/docs/experience-manager-learn/forms/prefill-fdm-db/introduction.h... 

Avatar

Employee Advisor

@luanh2511 It's a standard use case, if you have used FDM you can call FDM to pull data on zip and show it in the respective field.