Copied to clipboard

Flag this post as spam?

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


  • John French 32 posts 83 karma points
    Feb 13, 2017 @ 14:39
    John French
    0

    Cascadding dropdowns custom field type

    Hello,

    I'm trying to build a custom field type for umbraco forms which is a cascading dropdowns. I have one select box which will be populated from nodes in umbraco. Depending on the user choice - it will populate the 2nd select box with the children nodes of the node selected in dropdown 1.

    Any ideas on how I can achieve this or even if this is possible??

    Thanks for your help

  • Nigel Wilson 944 posts 2076 karma points
    Feb 13, 2017 @ 21:14
    Nigel Wilson
    0

    Hi James

    The first thing that comes to mind is using the Umbraco API and jquery / AJAX - on select of the first select box, you'd pass the selected node ID back to the API and it would return JSON containing the child names / ids. Your jquery could then iterate the JSON and build a list of options for the select list.

    Another way would be to output ALL parent / child node data into javascript arrays on page load, and then use jQuery / JavaScript to populate the second select list based on the selection of the first - this saves the round trips to the server, but adds to initial page load.

    Just some ideas.

    Cheers, Nigel

  • John French 32 posts 83 karma points
    Feb 14, 2017 @ 07:36
    John French
    0

    Yes I think your logic is sound - actually I'm trying to build this as a custom field type in umbraco forms (sorry don't think I made that clear in the original post) - I'm having difficulty wiring up the dropdowns to a controller to populate the select boxes and then also been able to store the selections when the form is submitted..

  • Kunal 19 posts 116 karma points
    Nov 01, 2017 @ 21:36
    Kunal
    0

    Hi John,

    Were you able to build these custom field type/s?

    Thanks, Kunal

  • Etienne 1 post 71 karma points
    Oct 12, 2018 @ 06:40
    Etienne
    0

    Hi John,

    We are also looking for a solution to create cascading dropdown list using Umbraco forms. Did you achieve it ? Thanks for your help. Etienne

  • Robert J. Bullock 386 posts 405 karma points
    Oct 12, 2018 @ 14:51
    Robert J. Bullock
    0

    Good luck with this! As far as I can see, Umbraco Forms is pretty much a black box. You can find minor examples of creating custom field types, but nothing very sophisticated. Try to find out how to create a custom drop down or prevalue datasource... It's near impossible. For a paid product, I'm really disappointed in how poorly supported Forms is.

Please Sign in or register to post replies

Write your reply to:

Draft