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.

Gravity checkbox to advanced custom fields checkbox

  1. I have built a form in Gravity Forms that posts to a custom post type. I have all the input fields working and advanced custom fields being passed just fine except the fields that I want multiple values from. I am trying to allow the user to select multiple values from a checkbox gravity form field and have it populate a checkbox advanced custom field and the advanced custom fields isn't getting populated. Can anyone provide any help or insight on how to get this working?

    Posted 12 years ago on Friday January 13, 2012 | Permalink
  2. Any help on this??

    Posted 12 years ago on Tuesday January 17, 2012 | Permalink
  3. It looks like ACF uses hidden fields to store the type of the data in a post fieldso it is suggested from ACF that I need to add some code on gravity forms side to also create that field type.

    This is what the support at ACF mentioned:

    IE a field with the name main_image also has a hidden field _main_image that points to the configuration options on acf, the value of _main_image is another post meta in the form of field_4eeec93d8e962, afaik if that does not exist then the field values can't be populated(you don't know the field type).

    Can't really help more but generally you COULD hard code that value for each field type you have, tough not recommended.

    Im not sure how this can be done...or if this gives anyone any ideas. But it looks like there is something I need to do on the gravity forms side.

    Posted 12 years ago on Tuesday January 17, 2012 | Permalink
  4. Hello Hello ?? :)
    Seems awfully quite in this post.....someone wish to shed some light?

    Posted 12 years ago on Thursday January 19, 2012 | Permalink
  5. Please.....could use some help here. Still no luck trying to get this problem resolved.

    Posted 12 years ago on Monday January 23, 2012 | Permalink
  6. Hey fallingup,

    We are pretty familiar with the advanced custom fields and gravity forms. I believe we can help you out f we had a tad bit more understanding of exactly what your trying to accomplish. I am assuming what your trying to do is have check boxes in a form from gravity that allows the user to check multiple selections. Then you would like each of those selections be dynamically populated to the appropriate ACF fields? Please add a little more clarification and we will see what we can do to help out.

    Posted 12 years ago on Monday January 23, 2012 | Permalink
  7. Hi!
    Your the best! Thanks so much for helping :)

    Yes precisely. Here we go....
    You are correct.

    So basically what we are creating is a directory type site for a client. When a user creates a listing they can choose one or multiple different services or repairs that they offer.

    So what we have at this point is a gravity form for the users to post a new custom post type that we created for listings. I have ACF fields created for all the data, and everything is working great. When a new post is posting through the front end (the new gravity form) the post is created, both WP custom fields and the ACF custom field inputs are populated with the entry from the gravity forms. This all works when a gravity forms field is passed to a regular text input ACF field. However other ACF fields such as multi-select dropdown, checkboxes (which I am particularly wanting to use), image fields, etc. are not getting populated when the gravity form is submitted. It looks like the custom fields (native WP custom fields meta boxes show values) are created, but the ACF fields in the edit post screen are blank.

    The goal is that if the client wanted to edit a listing he can easily go in and edit the checkboxes (with the predetermined service and repair options - meaning he does not want people to insert their own services and repairs, he wants them to have to choose between 10 or so - hence using checkboxes).

    So that's the jist of it. From everything I have read on this forum and on ACF, it seems as though ACF creates a new field with an underscore for the edit post screen fields. So...a new custom field created through ACF title "services" - gets populated with an input value through Gravity forms, but it sounds like I also need a way for it to populate "_services" as well??

    Let me know if that gives you enough to go off or makes sense?

    Thanks Again!

    Posted 12 years ago on Monday January 23, 2012 | Permalink
  8. BTW... I am using the latest versions of both plugins:

    Gravity forms: v1.6.2
    ACF: v3.0.6

    Posted 12 years ago on Monday January 23, 2012 | Permalink
  9. Hi twymand,

    does that info help?

    Posted 12 years ago on Wednesday January 25, 2012 | Permalink
  10. Sorry been away from the computer. I am going over your info now and should be able to provide a solution to help you out. So I am clear in short you want the gravity form to have checkbox fields which you also want to be checked in the custom post type admin section. Where it gets a little tricky if I am understanding correctly. You plan on keeping the form live for the customers to go update which check boxes they want, when they want, and have that reflect in the admin dashboard for that particular custom post type.

    I am assuming when you first set up both gravity forms as well as ACF that you are naming them the same? As well as using the "custom field" in Gravity forms for your check boxes and routing them to the appropriate ACF field under "custom field name" - "New or Existing" . Sorry if this seems like basic questions but I want to get a little more clear about what you have already done.

    On a site we are creating now we are using both gravity and ACF to manage each client.

    <?php
    if(isset($_GET['YOUR CHECK BOX FIELD NAME'])){ ?>
    <?php
    global $wp_query;
    $postid = $wp_query->post->ID;
    $custom_fields = get_post_custom($postid);
    $my_custom_field = $custom_fields['YOUR CHECK BOX FIELD NAME'];
    update_post_meta($postid, 'YOUR CHECK BOX FIELD NAME', 'Original Selected Checkbox Selection Name', 'Updated Selected Checkbox Name'); ?>
    <?php } ?>

    The above function allows you to update the individual "Users" selections by passing the varialble through the form and having it redirect to the same page. So you would put this into which ever file contains the form. What this does once submited is check to see if any checkboxes have been checked in the ACF field "YOUR CHECK BOX FIELD NAME" and if so is then checks to see if "Original Selected Checkbox Selection Name" is still checked and will update the selections with the "Updated Selected Checkbox Name".

    Is this getting closer to what your trying to accomplish?

    Posted 12 years ago on Wednesday January 25, 2012 | Permalink
  11. Hi twymand,

    Thanks so much for the help. This is close. However I don't need the users to be able to update their listings. The admin can make any changes necessary from the backend. All I need is to be able to have the ACF checkbox fields get populated once the user "posts" their listing through the front-end.

    Posted 12 years ago on Monday January 30, 2012 | Permalink
  12. Ok so I have an update. I just upgraded to ACF 3.0.7 and I am now getting data passed. However on the gravity forms I have post field (custom field checkbox) and when I select multiple values on that form I only get one ACF checkbox field populated on the backend. Although I see the custom field values are created just not all of the ACF checkbox values...

    any thoughts on that?

    Posted 12 years ago on Thursday February 2, 2012 | Permalink
  13. I have found the root of the issue. It looks like ACF values get populated with gravity forms ONLY when there is not multiple options. For example a radio button gravity forms post field populates one ACF radio button. It is the multiple selection items that do not get populates. When going from gravity forms checkbox post field to ACF checkbox, f there are multiple values that are selected from the gravity forms, only one value gets passed and populated for ACF. Same thing on multi select dropdowns.
    This to me seems like it is an issue with gravity forms? Any insight?

    Posted 12 years ago on Friday February 10, 2012 | Permalink
  14. Hey fallingup sorry for being so quite but I am in the process of going through this same situation. It seems like gravity forms does not allow for multiple fields to be passed through the form submission. I wish there was a tad bit more support on this issue as it seems very common that you would want the user to select multiple categories and have those categories be populated based off of which ever ones were selected.

    Posted 12 years ago on Thursday February 16, 2012 | Permalink
  15. When referencing categories I am pretty much talking about multiple checkboxes

    Posted 12 years ago on Thursday February 16, 2012 | Permalink
  16. I think I found the solution.

    Add the following code to your functions.php file. Make sure to update the GF field labeled 51 to the ID number of the form your checkboxes are on.

    http://www.pastie.org/3391927

    Posted 12 years ago on Thursday February 16, 2012 | Permalink
  17. ok has anyone figured this out yet or is there a fix for this
    i am using the latest version and i have several checkboxes in my form and when form is submited it makes several new custom fields for check box values and also says just says array for some custom field values.
    really need help on this one for it is stopping my site launch.....

    Posted 11 years ago on Tuesday December 25, 2012 | Permalink
  18. Have you contacted the author of the Advanced Custom Fields plugin? It sounds like the integration or implementation is related to their plugin. Gravity Forms is collecting the data, but it needs to be hooked to ACF somehow. I found a couple of relevant topics online:

    http://support.advancedcustomfields.com/discussion/544/acf-and-gravity-forms/p1

    http://wpquestions.com/question/show/id/2899

    Posted 11 years ago on Wednesday December 26, 2012 | Permalink
  19. ok so u are saying i need to add ACF 1st because this MADE theme already has meta fields u can add...
    are you familiar with the MADE theme by themeforest...

    Posted 11 years ago on Wednesday December 26, 2012 | Permalink
  20. @nitestop, please start a new topic as piggybacking on to this one has become confusing. Please begin a new topic and clearly state what you need help with. I'm not saying you need to use ACF, but that is what this topic is about, so I thought that was what you were asking about. Feel free to ignore that advice.

    Posted 11 years ago on Wednesday December 26, 2012 | Permalink

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