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.

Multiple post title fields - conditional logic decides which to use.

  1. I'd like to be able to create a form that can map to different custom post types, depending on some conditional logic.

    Ex. form:
    -------------------------------------------------
    Select post type (radio buttons):
    -post type 1
    -post type 2

    Post title field 1:
    //conditional logic: Show this field if post type is 'post type 1'

    Post title field 2:
    //conditional logic: Show this field if post type is 'post type 2'
    -------------------------------------------------

    My alternative for now is to create separate forms for each post type, which is not the end of the world, but it does clutter up my interface more than I'd like.

    Would love to see this ability added and would be very grateful if you have any alternative suggestions.

    Posted 10 years ago on Tuesday April 24, 2012 | Permalink
  2. You could reference this thread: here http://www.gravityhelp.com/forums/topic/custom-posts-and-custom-taxonomies

    This thread discusses how to set the taxonomy and not the post type, but the concept is the same. What you want to do is possible and it would be similar to the taxonomy examples in that forum thread above, but instead of setting the taxonomy type, you would be setting the post type.

    Posted 10 years ago on Tuesday April 24, 2012 | Permalink
  3. I think I've got that part down Rob. I believe whats holding me back is that Gravity forms only allows a single "post title" field per form.

    The post title field selects which post type to map to.
    Since I want the user to select from multiple post types, I need to have multiple post title fields.

    Posted 10 years ago on Tuesday April 24, 2012 | Permalink
  4. David Peralty

    So from what I understand, in order to do what you want, it would be ideal if the Custom Post Type's plugin supported some form of dynamic population so that a selection in another field changed what post type the title field was mapped to. So you might want to ask the plugin author about this.

    As for how Gravity Forms is currently set-up, there is no way to allow multiple title fields in a single form because Gravity Forms isn't set-up to understand which one would be used as the real WordPress post title.

    So for now, I would say your original idea of having separate forms, and sending a user to one or the other based on their selection would be the easiest way to achieve your goals.

    Posted 10 years ago on Tuesday April 24, 2012 | Permalink