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.

show subcategories depending on selected primary category

  1. mgannon37
    Member

    I have some form requirements and was wondering how it might be accomplished with Gravity Forms. I’ve created a form that is a Physician Case Report. It contains a category post field for the primary diagnosis, ‘cancer’ for instance. This has a whole set of it’s own subcategories of cancer types, like melanoma, brain, stomach, etc. What I want to do is show a specific set of subcategories, depending on the category selected in the primary category field. Is there some way I can do this?

    I tried the conditional logic on the subcategory field, but it did not include the first category field as an option in the logic. I'm using GF 1.5.2.8

    Thank you.

    Posted 8 years ago on Tuesday August 23, 2011 | Permalink
  2. If you are using the Post Category it doesn't support conditional logic because it's dynamically populated when the form is displayed. It doesn't work like a standard drop down. So conditional logic cannot be triggered by it.

    The only way to do what you want to do would be to use a standard drop down field for the category selection and sub-category selections with conditional logic. You'd then have to write custom code to set the post category to this value when the form is submitted. So it would have to be done as a customization.

    Posted 8 years ago on Tuesday August 23, 2011 | Permalink
  3. mgannon37
    Member

    Darn! Well, thanks for letting me know how it needs to be done.

    I might simply give my subcategories names that include their parent name, like 'parentname-child' and just present the parent category choice, along with one big subcategory list, where the user is required to scroll through to those of interest. Its a bit cumbersome but might work and still let me use all the WordPress categories instead of making my own drop-downs.

    Thanks for your suggestions. I still love the plug-in!

    Posted 8 years ago on Tuesday August 23, 2011 | Permalink
  4. mgannon37
    Member

    When you say "done as a customization" do you mean something we can request of Gravity Forms for payment?

    I've posted another query here but have not heard back yet.

    The form in question: http://cannabisclinicians.org/case-reports-form/
    At this point, I'm at a lose as to how to proceed. Any suggestions would be most appreciated.

    Thank you.

    Posted 8 years ago on Wednesday August 31, 2011 | Permalink
  5. We do not do customization ourselves. You would either have to write the necessary customization yourself using the available hooks/filters to customize Gravity Forms or hire a developer to handle the customization for you.

    Posted 8 years ago on Wednesday August 31, 2011 | Permalink
  6. mgannon37
    Member

    OK. I will wait to see how the sort order on the front end of Post Category fields is resolved before I jump into the hooks and filters. If I can have one large alphabetized sub-category, it should do the trick.

    Thanks for the update.

    Posted 8 years ago on Wednesday August 31, 2011 | Permalink

This topic has been resolved and has been closed to new replies.