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.

Category field and custom sort order

  1. I'm interested in achieving a custom sort order for categories in a form. In four cases, the sort is alphabetical, but in one case, the order is neither alphabetical nor by ID. Because there isn't an easy to to do this, I'd like to know what is the hard way to do this? :)

    The form is not visible to non-members, unfortunately.

    Beth

    Posted 11 years ago on Monday June 11, 2012 | Permalink
  2. BTW, I'm using check boxes on this form which allows users to upload a custom post including Categories.

    Posted 11 years ago on Monday June 11, 2012 | Permalink
  3. David Peralty

    How do you want to sort the fourth case if not by category ID or alphabetical? Would you be sorting it manually? And if so, can you just pre-populate your checkbox with the categories you want in the order you want them in?

    http://www.gravityhelp.com/documentation/page/Gform_pre_render
    http://www.gravityhelp.com/documentation/page/Gform_field_choices

    Posted 11 years ago on Monday June 11, 2012 | Permalink
  4. Okay, after looking at the links for 3 days, I can't quite get there.
    This code yields a blank checkbox:
    http://pastebin.com/6KzbZGju

    And do I need this code?

    <?php
    add_filter("gform_field_choices", "form_submit_button", 10, 2);
    ?>
    Posted 11 years ago on Thursday June 14, 2012 | Permalink
  5. Haven't received any answer for awhile. Should I move this to a Priority Support Form?

    Posted 11 years ago on Tuesday June 19, 2012 | Permalink
  6. David Peralty

    Do you have a link to your form? Can you tell me more about what you are trying to do? Also, why do you have $category->name in your field array? And you shouldn't need another hook to get this sorted out. We just need to figure out why your current one isn't working.

    Posted 11 years ago on Tuesday June 19, 2012 | Permalink
  7. The form is here:
    https://ohalah.org/resources/resource-submission-form/

    In the checkbox Resource Categories, when you click each of the first four checkboxes, another checkbox field with choices I'd like to be alphabetically arranged. But they're not.

    The fifth checkbox, Tanakh, I need to set the order of myself; users will expect the list to be in book order.

    Posted 11 years ago on Tuesday June 19, 2012 | Permalink
  8. Is there anything else I need to provide to get some help?

    Posted 11 years ago on Thursday June 21, 2012 | Permalink
  9. David Peralty

    Can you send me a WordPress admin user/pass to peralty@rocketgenius.com and I'll take a look?

    Posted 11 years ago on Thursday June 21, 2012 | Permalink
  10. I'm not authorized to do that, I'm sorry to say.

    Posted 11 years ago on Thursday June 21, 2012 | Permalink
  11. I could set up a test situation on a site that I could give you password access to, if necessary.

    Posted 11 years ago on Thursday June 21, 2012 | Permalink
  12. David Peralty

    We can try that, but if it isn't the same variables at play, I can't promise that whatever solution I come up with will work for what you are trying to do.

    Posted 11 years ago on Thursday June 21, 2012 | Permalink