PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Populate and filter multi/select field based upon text field

  1. This query is two-fold, are either of these possible? If so, can someone advise/offer guidance

    1) We would like to populate a drop down list (multi/select) with enabled Wordpress users.
    2) We would like to filter the drop down list (multi/select) based upon the content of either another select field OR a text field.

    Any advice or guidance is appreciated.

    Posted 11 years ago on Friday February 15, 2013 | Permalink
  2. To dynamically populate a drop down, please see this documentation:
    http://www.gravityhelp.com/documentation/page/Dynamically_Populating_Drop_Down_Fields

    You will use the gform_pre_render function and will read the WordPress database to return all active users.

    In this example http://www.gravityhelp.com/documentation/page/Gform_pre_render#Examples instead of get_posts on line 14, you will use the WordPress function get_users http://codex.wordpress.org/Function_Reference/get_users

    To filter the choices in a drop down, you will need to use conditional logic. Conditional logic can be used with radio buttons, checkboxes or drop downs, so you'll need to use a drop down select for your earlier selection.

    You may need to do this with two forms, or implement AJAX to get the drop down populated dynamically after the first selection is made (or value is entered for your filter.) Here is one user's explanation of how he accomplished something similar to this: http://www.gravityhelp.com/forums/topic/gform_pre_render-upon-previous-dropdown-condition#post-137821

    Can you explain what sort of information your first selection would contain and how that would change the second drop down?

    Posted 11 years ago on Monday February 18, 2013 | Permalink
  3. Thanks for coming back to me.

    The first drop down would either be, just that, with a list of skills that can be/are attributed to users; or it will be a free-text box for the user to manually type the same.

    This, in theory, would limit the second drop down to only those user records with the appropriate skill.

    Posted 11 years ago on Monday February 18, 2013 | Permalink
  4. You can do this, with code similar to that posted here:
    http://www.gravityhelp.com/forums/topic/gform_pre_render-upon-previous-dropdown-condition#post-137821

    It is a customization and a fairly involved one at that. It's not something that is built in to Gravity Forms.

    Posted 11 years ago on Monday February 18, 2013 | Permalink
  5. Thanks for the follow-ups on this.

    Taking it a step a little further, are there any examples or guidance available on how to do this based upon user-entered text rather than a selection in a drop down list? E.g.

    1) User types a word or words in text box
    2) Filtered results are returned to multi select box

    Thanks

    Posted 11 years ago on Wednesday February 27, 2013 | Permalink
  6. I don't know of any examples to use an auto-complete or auto-suggest script like that.

    Posted 11 years ago on Monday March 4, 2013 | Permalink