Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Lee Kelleher 4010 posts 15743 karma points MVP 12x admin c-trib
    Nov 24, 2020 @ 14:53
    Lee Kelleher

    Umbraco Forms - Auto-populate fields with AJAX fetch

    Hey Umbraco Forms fans!

    Version numbers upfront: Umbraco v8.6.6, Umbraco Forms v8.5.5.

    I'm trying to figure out a good way of achieving the following...

    On my form, I have address fields (e.g. Address1, Address2, City, Postcode), my client would like the address fields to be auto-populated by a postcode lookup. I already have an API for the postcode lookup, (via JS/AJAX request).

    Does anyone know if there is an existing way to do this with Umbraco Forms? or should I be developing my own custom field type for this? or hacking around with JS until I can make it work?

    I've tried searching around to see if anyone else has tried this before, but my google-fu is failing me.

    Thanks in advance!

    - Lee

    Note: I tried to post this question in the Umbraco Forms forum category, but it appears that all new questions are under the "Using Umbraco And Getting Started" category. ¯\_(ツ)_/¯

  • Matthew Wise 269 posts 1351 karma points MVP 3x c-trib
    Nov 24, 2020 @ 15:16
    Matthew Wise


    I would go with a custom field. That way you can include the JS as you need it.

    For working out which ones to populate you could create a mapping similar to how I do in I have done similar since in v8 but its not somewhere I can link to :)


  • Lee Kelleher 4010 posts 15743 karma points MVP 12x admin c-trib
    Nov 24, 2020 @ 16:43
    Lee Kelleher

    Thanks Matt, that's most helpful!

    I thought I'd need to take the custom field-type approach, but wanted to see if/how anyone else had done it.

    I'll take a look at the way you've done the mapping, (in "listmapping.html"). Good inspiration, thank you!

    - Lee

Please Sign in or register to post replies

Write your reply to: