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.

[Possible Bug] Custom fields of Post fields as checkbox stores only one value

  1. Nirav
    Member

    My field created using Post fields > Custom field, and selected checkboxes in Field type only saves one value (last checkbox to be selected) in postmeta. It shows the values of checked options if I view them in the entries but in postmeta, it only saves the last value.

    Example:
    - Fuel
    - Meals
    - Hotel

    Then if fuel & hotel is checked, they both show up under the field if I am viewing the entries of this form but in postmeta, only hotel is saved.

    Posted 12 years ago on Tuesday November 22, 2011 | Permalink
  2. Nirav
    Member

    My bad! They are being saved as different entries in postmeta table.

    Posted 12 years ago on Tuesday November 22, 2011 | Permalink
  3. I think you are right, it does save them as separate values but the notification e-mail shows only 1 value, is that correct? I'm having a similar issue.

    Posted 12 years ago on Tuesday November 22, 2011 | Permalink
  4. When using checkboxes with the Post Custom Field it stores each selection as it's own custom field using the same custom field name.

    This is how you store data in WordPress custom fields when there is multiple values with the same custom field name.

    You then have to configure your theme to display them by looping through and outputting the custom field values with that custom field name.

    The alternative is to store the values as an array in a single custom field row. But the way Gravity Forms implements it is the accepted WordPress way of storing multiple custom field values that use the same name.

    In either instance you have to loop through the values to output them properly in your theme.

    @milljeff2010 It should output all of them. If not, please describe what exactly you are doing and if it's the {all_fields} that isn't outputting them or the individual field merge tag itself.

    Posted 12 years ago on Tuesday November 22, 2011 | Permalink
  5. tried doing the individual field merge tag and same issue occurred, i created a new post about the problem:
    http://www.gravityhelp.com/forums/topic/notification-form-with-2-checkbox-areas-not-showing-values-for-2nd-checkboxes

    Posted 12 years ago on Tuesday November 22, 2011 | Permalink

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