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.

User Specific Form Fields

  1. Hello,

    I've created a gravity form to act as a work request form. Essentially the user logs into a private site, and fills out the work request which is then submitted to a field rep via email routing. Easy enough.

    What I'd like to accomplish is to have a drop down menu populated with selection choices based on the user logged in. In other words, when User A logs in he/she can pick from option 1 and 2, but when User B logs in he/she can only pick option 3 and 4.

    I'm currently using the Extra User Details plugin (http://wordpress.org/extend/plugins/extra-user-details/) to add additional fields to the user profile and pre-populating single line text form fields using the Default Value variable created with the plugin (e.g. {user:user_phone} ).

    However, what I can't figure out is how to tie drop down selections (radio buttons, checkboxes) to the user. I realize there may be some custom code involved to pull this off, or an additional plugin, etc. Any help pointing me in the right direction would be appreciated.

    Thoughts?

    Posted 13 years ago on Wednesday December 7, 2011 | Permalink
  2. Hi 10for2,

    Using custom code you could retrieve and dynamically populate the values of any of the multiple option fields (dropdown, radio, checkbox) based on the current user. Here is a walk-through which demonstrates how to dynamically populate a drop down. Use this to get started and let me know if you run into any other questions. :)

    http://www.gravityhelp.com/documentation/page/Dynamically_Populating_Drop_Down_Fields

    Posted 13 years ago on Thursday December 8, 2011 | Permalink
  3. David,

    Thank you for your quick reply. I've read several of your posts before and you're very helpful on these forums. I appreciate you chiming in here.

    I read through the page you linked and I understand the principle. I played around with the code for a while and am still having trouble with the exact arguments to use.

    Please see the code.

    I think I'm supposed to use "get_metadata" to retrieve the user fields. But I'm not sure what follows in the parenthesis and then how that translates to the array. Ultimately I'm trying to grab information listed in a "meta_key" (e.g. community_name) in the user profile.

    Posted 13 years ago on Friday December 16, 2011 | Permalink