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.

Checking two categories in one hit

  1. I'm building a form for a theme that uses both custom fields as categories and standard category listings.
    The custom fields are used to generate pre formatted posts. The only problem here is that there is no dynamic relationship between the two. So for search functions within the theme there is a necessary requirement to create standard categories to enter the posts into as well.

    The gravity form does a wonderful job of picking up the custom fields and populating the pre formatted posts very nicely and I commend you guys on this intuitive piece of software.

    It also does a great job at populating ordinary posts in their categories, BUT I'm wanting do know if there is any way it can do both at once? Without asking users to enter the information twice.

    How would I go about say dynamically populating a hidden field from the previous entry?

    i.e.

    (Custom field multi choice) for sale, or for rent

    (Post category, admin only) dynamically populating the field based on previous entry being either for sale or for rent.

    Is this possible?

    Posted 14 years ago on Wednesday April 6, 2011 | Permalink
  2. I'm not entirely clear what you are trying to accomplish. It is possible to dynamically populate fields using either PHP or passing data to it via the query string. But i'm not entirely clear on what you want to populate the field value with, based on data from the previous entry as in a form entry or as in a Post that was previously created?

    Posted 14 years ago on Wednesday April 6, 2011 | Permalink
  3. ok, let me rephrase. I want to dynamically populate a hidden post category field from a custom field directly preceding it in the same form. I want to replicate the answer in the hidden field.

    Posted 14 years ago on Wednesday April 6, 2011 | Permalink
  4. So would the value you want to populate the hidden field with come from a custom field on a post the form is being displayed on OR from another field value on the same form?

    Posted 14 years ago on Wednesday April 6, 2011 | Permalink
  5. external to the form I believe, based on my very simple stumbling understanding of php I think i need to call this custom function:

    function red_add_fields($id){
    $listing = stripslashes($_POST["listing"]);

    which does this

    add_post_meta($id, 'listing', $listing);
    I need to provide 'for rent' or 'for sale' as the variables.

    The problem here is that I want to do this on the basis of the users entry of 'for sale' or 'for rent' in a standard post category form field.

    I need both the standard and custom category populated for this form to be any use to me and I cant ask the user to enter for sale twice because that would just be stupid.

    Sorry if I'm still being confusing but I'm an old dog that has been running extremely successful sites with pure xhtml and css static pages for years and I have never ventured into php or even javascript for that matter, until now.

    Posted 14 years ago on Thursday April 7, 2011 | Permalink
  6. Here is a forum thread that discusses populate a form field value with data from a post meta custom field:

    http://www.gravityhelp.com/forums/topic/using-custom-fields-to-populate-hidden-fields

    Posted 14 years ago on Thursday April 7, 2011 | Permalink
  7. Thanks Carl! The info there was good and it gets a simplistic version of what I want off the ground right away.

    The ability to build increasingly complicated forms with little code knowledge is really cool.

    Gravity forms is a really nice piece of software.

    Posted 14 years ago on Friday April 8, 2011 | Permalink